Display DataLesson 17Free preview
Add Link to Details
This lesson is part of Django · All levels
Summary
Detailed pages are usually accessed via a dynamic URL such as /members/1. The id parameter is captured by a path converter and then taken from the object with objects.get(). You can also use get_object_or_404 to make it more concise.
Key points
- Dynamic URLs use converters such as <int:id>
- Take the object with objects.get
- Get_object_or_404 gives the 404 page automatically
- Link from the list to the detail page
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.