0PricingLogin
Django Academy · Lesson

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

  1. Writing a Function-Based View
  2. URL Patterns with path()
  3. Capturing URL Parameters
  4. Including App URLs and Naming Routes
← Back to Django Academy