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.
To install the sitemap app, follow these steps:
Add
"django.contrib.sitemaps"
to yourINSTALLED_APPS
setting.Make sure your
TEMPLATES
setting contains aDjangoTemplates
backend whoseAPP_DIRS
options is set to True. It's in there by default, so you'll only need to change this if you've changed that setting.Make sure you've installed the sites framework.