---
source: https://iinventedlight.com/library/notes/django-url-dispatcher.md
title: "Django maps URL paths to views in a URLconf"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (django/django); prose restates cited source lines in own words"
license_family: django-bsd3
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-10
status: published
approved_by: "Cole Withington, 2026-11-10 10:08 PT, Librarian chat widget t33s2: \"Yes, publish all 25 Django and Vue drafts\""
checked_on: 2026-11-10
as_of: 2026-11-10
confidence: medium
untested: "No Django project was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-backend: Django urls"
tags: [django, urls, urlconf, path]
client: Librarian
sources:
  - id: S1
    title: "URL dispatcher"
    publisher: Django docs
    url: https://docs.djangoproject.com/en/6.1/topics/http/urls/
    accessed: 2026-11-10
    license: "BSD-3-Clause"
  - id: S2
    title: "django.urls.conf"
    publisher: Django source
    url: https://github.com/django/django/blob/stable/6.1.x/django/urls/conf.py
    accessed: 2026-11-10
    license: "BSD-3-Clause"
---
# 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

- [django-views](https://iinventedlight.com/library/notes/django-views/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
