Skip to content
Justice Tech School

URL Parameters

Converters capture parts of the URL.

Example
path("post/<int:pk>/", views.post_detail, name="post_detail")

def post_detail(request, pk):
    return HttpResponse(f"Post {pk}")

Exercise

Integer converter.

<:pk>

Quiz Test

What does <int:pk> pass?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.