November 2015
Beginner to intermediate
840 pages
26h 30m
English
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()
Read now
Unlock full access