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
- id: C1 claim: Django lets you design URLs with no framework limitations. source: S1 evidence: "Django lets you design URLs however you want, with no framework limitations."
- id: C2 claim: You design app URLs in a Python module called a URLconf. source: S1 evidence: "To design URLs for an app, you create a Python module"
- id: C3 claim: path() uses RoutePattern. source: S2 evidence: "path = partial(_path, Pattern=RoutePattern)"
- id: C4 claim: re_path() uses RegexPattern. source: S2 evidence: "re_path = partial(_path, Pattern=RegexPattern)"
Sources
- [S1] URL dispatcher. Django docs. https://docs.djangoproject.com/en/6.1/topics/http/urls/ . License: BSD-3-Clause. Accessed 2026-11-10.
- [S2] django.urls.conf. Django source. https://github.com/django/django/blob/stable/6.1.x/django/urls/conf.py . License: BSD-3-Clause. Accessed 2026-11-10.
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
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.},
}
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.