Commit d0d9e74b authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Add events sitemap

parent 324e289f
from django.contrib import sitemaps
from django.urls import reverse
from . import models
class StaticViewSitemap(sitemaps.Sitemap):
changefreq = 'daily'
def items(self):
return ['events:index']
def location(self, item):
return reverse(item)
class EventSitemap(sitemaps.Sitemap):
def items(self):
return models.Event.objects.filter(published=True)
def location(self, item):
return item.get_absolute_url()
sitemap = {
'events-static': StaticViewSitemap,
'events-events': EventSitemap,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment