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 yourINSTALLED_APPS
setting. - Make sure your
TEMPLATES
setting contains aDjangoTemplates
backend ...
Get Mastering Django: Core now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.