Django sitemaps: generate sitemap XML files
Answer: Django ships a sitemap-generating framework that writes sitemap XML files. That information helps search engines index your site. Add django.contrib.sitemaps to INSTALLED_APPS, and make sure the sites framework is installed.
Notes
The sitemap application does not install any database tables. The sitemap file name is not important, but the location is. Sitemap classes subclass django.contrib.sitemaps.Sitemap. The sitemap view takes a required sitemaps argument.
Reference list
sitemapsgenerates sitemap XML files.INSTALLED_APPSshould include django.contrib.sitemaps.sitesframework must also be installed.
See also
Claims
- id: C1 claim: Sitemap information helps search engines index your site. source: S1 evidence: "This information helps search engines index your site."
- id: C2 claim: The sitemap file name is not important, but the location is. source: S1 evidence: "The name of the sitemap file is not important, but the location is."
- id: C3 claim: Add django.contrib.sitemaps to INSTALLED_APPS. source: S2 evidence: "Add `
'django.contrib.sitemaps'to your :setting:INSTALLED_APPS` setting."
Sources
- [S1] The sitemap framework. Django docs. https://docs.djangoproject.com/en/5.2/ref/contrib/sitemaps/ . License: BSD-3-Clause. Accessed 2026-11-18.
- [S2] sitemaps.txt. Django. https://raw.githubusercontent.com/django/django/stable/5.2.x/docs/ref/contrib/sitemaps.txt . License: BSD-3-Clause. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Django docs, The sitemap framework; Django, sitemaps.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, The sitemap framework; Django, sitemaps.txt. BSD-3-Clause (https://raw.githubusercontent.com/django/django/main/LICENSE). Copyright Django Software Foundation and individual contributors.
Cite this
iinventedlight. 2026. "Django sitemaps: generate sitemap XML files." iinventedlight Library, iil:note:43y4rz91, version of 2026-11-18. https://iinventedlight.com/library/notes/django-sitemaps/. License: CC-BY-4.0.
@misc{iil_note_43y4rz91,
author = {{iinventedlight}},
title = {{Django sitemaps: generate sitemap XML files}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/django-sitemaps/},
note = {Permanent ID iil:note:43y4rz91. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- django-sitemaps.table.json (table; CC-BY-4.0)
- django-sitemaps.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/django-sitemaps.md.