Created
May 31, 2012 17:44
-
-
Save daikeren/2844991 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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