The url Tag and static Tag
Link routes and assets without hardcoding paths.
Never Hardcode Paths
Typing URLs and file paths by hand breaks the moment they change. Django gives you the url and static tags to build them safely. 🔗
The url Tag Builds Routes
The url tag turns a route name into its real path. Rename the URL pattern later and every link updates automatically.
<a href="{% url 'home' %}">Home</a>All lessons in this course
- render() and the Template Context
- Template Tags and Filters
- Template Inheritance with extends and block
- The url Tag and static Tag