How to Link a Page in Django?

QuestionsCategory: DjangoHow to Link a Page in Django?
devchandan Staff asked 4 weeks ago

In Python, Django Framework.

I want to Link the page urls in Django Template. But It is Not Working. Please help.

1 Answers
matrix Staff answered 4 weeks ago

In Python, Django,
In Urls.py file we write the URLs Like

url(r'^$', 'home.homepage', name='homepage'), 
url(r'^contact$', 'home.contact', name='contact'),

Now in The Djnago Template File, We Will Use the URLs Like below,

<a href="{% url 'hmepage' %}">Home</a>
<a href="{% url 'contact' %}">Contact</a>