Skip to content

Instantly share code, notes, and snippets.

@daikeren
Created May 31, 2012 17:44
Show Gist options
  • Select an option

  • Save daikeren/2844991 to your computer and use it in GitHub Desktop.

Select an option

Save daikeren/2844991 to your computer and use it in GitHub Desktop.
from django.contrib.sitemaps import Sitemap
from blog.models import Blog
class BlogSitemap(Sitemap):
changefreq = 'daily'
priority = 0.4
def items(self):
return Blog.objects.all()
def lastmod(self, obj):
return obj.update_time
def location(self, obj):
return "/blog/%d" % obj.pk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment