The Sitemap framework

A sitemap is an XML file on your website that tells search engine indexers how frequently your pages change and how important certain pages are in relation to other pages on your site. This information helps search engines index your site. For more on sitemaps, see the sitemaps.org website.

The Django sitemap framework automates the creation of this XML file by letting you express this information in Python code. It works much like Django's syndication framework. To create a sitemap, just write a Sitemap class and point to it in your URLconf.

Installation

To install the sitemap app, follow these steps:

  • Add "django.contrib.sitemaps" to your INSTALLED_APPS setting.
  • Make sure your TEMPLATES setting contains a DjangoTemplates backend ...

Get Mastering Django: Core now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.