Including App URLs and Naming Routes
Use include() and name routes for reverse().
Two Levels of URLs
Django splits routing into the project's urls.py and each app's own. The project includes app URLs to keep things tidy.
Why Apps Get Their Own urls.py
Giving each app its own URL file keeps routes reusable and self-contained. You can drop an app into any project cleanly.
All lessons in this course
- Writing a Function-Based View
- URL Patterns with path()
- Capturing URL Parameters
- Including App URLs and Naming Routes