← All notes

Django URL configuration (URLconf)

Answer: To design URLs for an app, you create a Python module informally called a URLconf. That module maps URL path expressions to view functions. Use path() entries, and include other URLconfs with include().

Examples

from django.urls import path, include
from . import views

urlpatterns = [
    path("articles/<int:year>/", views.year_archive),
    path("blog/", include("blog.urls")),
]

Rules

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: Django docs, URL dispatcher; Django source docs, urls.txt. BSD-3-Clause (https://raw.githubusercontent.com/django/django/main/LICENSE). Copyright Django Software Foundation and individual contributors. Text was condensed and changed from the originals.

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

Cite this

Permanent ID: iil:note:scanjbhw

iinventedlight. 2026. "Django URL configuration (URLconf)." iinventedlight Library, iil:note:scanjbhw, version of 2026-11-18. https://iinventedlight.com/library/notes/django-urls/. License: CC-BY-4.0.

@misc{iil_note_scanjbhw,
  author = {{iinventedlight}},
  title = {{Django URL configuration (URLconf)}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/django-urls/},
  note = {Permanent ID iil:note:scanjbhw. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

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