Capturing URL Parameters
Read path converters like int and slug into views.
Why Capture Parameters
Many pages depend on a value in the URL, like a product id. Django lets you capture that value and pass it straight to your view.
Angle Bracket Syntax
You capture a piece of the URL with angle brackets. Whatever is inside becomes a named argument for your view.
path('post/<int:id>/', views.detail)All lessons in this course
- Writing a Function-Based View
- URL Patterns with path()
- Capturing URL Parameters
- Including App URLs and Naming Routes