← All notes

Django maps URL paths to views in a URLconf

Answer: Django lets you design URLs however you want. You do that in a Python module informally called a URLconf: a mapping from URL path expressions to view functions.

How a request is resolved

Django loads the root URLconf (usually ROOT_URLCONF, unless middleware sets request.urlconf) and looks for urlpatterns. urlpatterns is a sequence of path() and re_path() instances. Django checks those patterns in order, stops when one matches the requested URL, and then calls the given view.

path and re_path

path equals partial(_path, Pattern=RoutePattern). re_path equals partial(_path, Pattern=RegexPattern). The same module also defines include().

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Django documentation and source (django/django): Copyright (c) Django Software Foundation and individual contributors; BSD-3-Clause (https://raw.githubusercontent.com/django/django/stable/6.1.x/LICENSE). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Django docs, URL dispatcher, BSD-3-Clause (django/django); Django source, django.urls.conf, BSD-3-Clause (django/django). Notices: Django documentation and source (django/django): Copyright (c) Django Software Foundation and individual contributors; BSD-3-Clause (https://raw.githubusercontent.com/django/django/stable/6.1.x/LICENSE).

Cite this

Permanent ID: iil:note:fsfmc2ym

iinventedlight. 2026. "Django maps URL paths to views in a URLconf." iinventedlight Library, iil:note:fsfmc2ym, version of 2026-11-10. https://iinventedlight.com/library/notes/django-url-dispatcher/. License: CC-BY-4.0.

@misc{iil_note_fsfmc2ym,
  author = {{iinventedlight}},
  title = {{Django maps URL paths to views in a URLconf}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-10},
  url = {https://iinventedlight.com/library/notes/django-url-dispatcher/},
  note = {Permanent ID iil:note:fsfmc2ym. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/django-url-dispatcher.md.