Thursday, May 31, 2018

Re: href not working

On 31/05/2018 1:56 PM, Caleb Bryson wrote:
> So i am trying to create a directory with a Home,Blog,and Contact
> selection. But every time i click on one of them they all go back to
> the home page.

It feels like your urls.py is insufficiently fleshed out or maybe your
home page url isn't fully formed. Django obviously thinks that whatever
is handed in can be interpreted as requesting the home page view.

For example, I would expect your home page url pattern (url or re_path
depending on Django version) might look something like ...

url_patterns = [
    url(r'^$', home_page_view),
    ...
]

If you have omitted that $ anything will match and your home page view
will be called.

Just a guess


> How do i fix this, and here is the secton of code below. let me know
> if you need to see more
>
> <div class="well bs-sidebar" id="sidebar" style="background-color:#fff">
> <ol class="nav nav-pills nav-stacked">
> <li><a href='/'>Home</a></li>
> <li><a href='/blog/'>Blog</a></li>
> <li><a href='/contact/'>Contact</a></li>
> </ol>
> </div>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9dc7004b-4fff-412d-8560-6308f13db92c%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/073f2ff6-a8a9-da49-0e16-575db697b3f6%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment