Locked lesson.
About this lesson
Creating links in Django is similar to how you create them in HTML. However, in this lesson, we'll discuss the differences, and how to create them within your project.
Exercise files
Download this lesson’s related exercise files.
Creating Django Links.docx57.2 KB Creating Django Links - Solution.docx
57.7 KB
Quick reference
Creating Django Links
Django links are better than regular HTML links.
When to use
You should use Django links instead of regular HTML links every time you add a link to a webpage.
Instructions
To create a Django link to the home page:
<a href="{% url 'home' %}">Home</a>
Hints & tips
- <a href="{% url 'home' %}">Home</a>
- The name of each link comes from the name given in the urls.py file.
Lesson notes are only available for subscribers.