Source

armonge.info / blog / sitemaps.py

# -*- coding: utf-8 -*-

from django.contrib.sitemaps import Sitemap
from blog.models import Post

class BlogSitemap(Sitemap):
    changefreq = "never"
    priority = 0.5

    def items(self):
        return Post.objects.filter(public=True)

    def lastmod(self, obj):
        return obj.date_published