Skip to content

Instantly share code, notes, and snippets.

@rturowicz
Created March 23, 2013 13:07
Show Gist options
  • Save rturowicz/5227675 to your computer and use it in GitHub Desktop.
Save rturowicz/5227675 to your computer and use it in GitHub Desktop.
django - sitemap
# urls.py
from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
info_dict = {
'queryset': Entry.objects.all(),
'date_field': 'pub_date',
}
sitemaps = {
'flatpages': FlatPageSitemap,
'blog': GenericSitemap(info_dict, priority=0.6),
}
urlpatterns = patterns('',
url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
...
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment