Reputation: 1193
I am writing a navigation header in django. And i am having problem navigations between urls that i created.
urls.py
url(r'^home/$', home_page, name="home_url"),
url(r'^about/$', about_page, name="about_url"),
template
<a href="home_url>Home</a>
<a href="About_url>About</a>
When I click on this i am getting something like. mysite.com/home/home_url
How should i configure it so i can navigate to the correct link?
Upvotes: 1
Views: 54
Reputation: 51715
Read Naming urls docs:
For your code:
<a href="{% url 'home_url' %}" >Home</a>
<a href="{% url 'about_url' %}">About</a>
Upvotes: 4