🍡 Django - Sitemap
Updated at 2018-04-04 02:44
from django.contrib.sitemaps import views as sitemap_views
from django.views.decorators.cache import cache_page
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from blog.sitemaps import WeblogSitemap
sitemaps = {
'weblog': WeblogSitemap,
'flatpages': FlatPageSitemap,
}
urlpatterns = [
url(
r'^sitemap\.xml$',
cache_page(60 * 60 * 6)(sitemap_views.sitemap),
{'sitemaps': sitemaps}
),
]