8
After a bit of searching I found this Django Sitemaps and "normal" views. Following along Matt Austin’s answer I was able to achieve what I wanted. I’ll leave what I did, here for future reference.
sitemaps.py
from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import reverse
from website.models import Content
class StaticSitemap(Sitemap):
"""Reverse 'static' views for XML sitemap."""
changefreq = "daily"
priority = 0.5
def items(self):
# Return list of url names for views to include in sitemap
return ['landing', 'about', 'how-it-works', 'choose']
def location(self, item):
return reverse(item)
class DynamicSitemap(Sitemap):
changefreq = "daily"
priority = 0.5
def items(self):
return Content.objects.all()
urls.py
from website.sitemaps import StaticSitemap, DynamicSitemap
sitemaps = {'static': StaticSitemap, 'dynamic': DynamicSitemap}
urlpatterns = [
...
url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
]
Source:stackexchange.com