# Path: pagelets/sitemaps.py
# class PageSiteMap(GenericSitemap):
#     def __init__(self, priority=None, changefreq=None):
#         info_dict = {"queryset": Page.objects.all(), "date_field": "last_changed"}
#         super(PageSiteMap, self).__init__(info_dict, priority, changefreq)


from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from pagelets.sitemaps import PageSiteMap


admin.autodiscover()
sitemaps = {
    "pagelets": PageSiteMap(priority=0.6),
}


urlpatterns = [
    url(r"^admin/", include(admin.site.urls)),
    url(r"^pagelets-management/", include("pagelets.urls.management")),
    url(r"^cms/", include("pagelets.urls.content")),
    url(
        r"^sitemap\.xml$",
        "django.contrib.sitemaps.views.sitemap",
        {"sitemaps": sitemaps},

# Path: pagelets/sitemaps.py
# class PageSiteMap(GenericSitemap):
#     def __init__(self, priority=None, changefreq=None):
#         info_dict = {"queryset": Page.objects.all(), "date_field": "last_changed"}
#         super(PageSiteMap, self).__init__(info_dict, priority, changefreq)


# Path: sample_project/urls.py
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from pagelets.sitemaps import PageSiteMap



admin.autodiscover()
sitemaps = {
    "pagelets": PageSiteMap(priority=0.6),
}


urlpatterns = [
    url(r"^admin/", include(admin.site.urls)),
    url(r"^pagelets-management/", include("pagelets.urls.management")),
    url(r"^cms/", include("pagelets.urls.content")),
    url(
        r"^sitemap\.xml$",
        "django.contrib.sitemaps.views.sitemap",
        {"sitemaps": sitemaps},

    ),