28.3.5 Other Pages Sitemap

The sitemaps we’ve built so far cover all of the dynamic pages in our website, but none of them cover basic pages like the about page or our list pages. To remedy this, we can create a sitemap that lists these pages. As these pages are quite important, we give them a slightly higher than normal priority, as shown in Example 28.43.

Example 28.43: Project Code

suorganizer/sitemaps.py in bb71d3562d

 1   from django.contrib.sitemaps import Sitemap  2   from django.core.urlresolvers import reverse  .       ... 10   class RootSitemap(Sitemap): 11       priority = 0.6

We can then simply define a list of URL pattern names to be returned in items() and use each URL pattern name in location()

Get Django Unleashed 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.