# Path: staticgen/sitemaps.py
# def override_sitemaps_domain(sitemaps):
#     staticgen_sitemaps = {}
#     for section, site in sitemaps.items():
#         cls_name = 'Staticgen{name}'.format(name=site.__name__)
#         staticgen_sitemaps[section] = type(cls_name, (StaticgenSitemap, site), {})
#     return staticgen_sitemaps
# 
# Path: example/views.py
# class ErrorView(TemplateView):
#     template_name = 'example/error.html'
# 
# class IndexView(TemplateView):
#     template_name = 'example/home.html'
# 
# class PostDetailView(DetailView):
#     model = Post
#     context_object_name = 'post'
#     template_name = 'example/post_detail.html'
# 
# class PostListView(ListView):
#     model = Post
#     paginate_by = 5
#     context_object_name = 'post_list'
#     template_name = 'example/post_list.html'
# 
# class RedirectToHomeView(RedirectView):
#     permanent = False
#     query_string = True
#     pattern_name = 'homepage'
# 
# Path: example/sitemaps.py
# class ExampleSitemap(Sitemap):
#     changefreq = 'never'
#     priority = 0.5
# 
#     def items(self):
#         return Post.objects.all()


from django.conf.urls import patterns, url, include
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from staticgen.sitemaps import override_sitemaps_domain
from .views import ErrorView, IndexView, PostDetailView, PostListView, RedirectToHomeView
from .sitemaps import ExampleSitemap
# -*- coding: utf-8 -*-

from __future__ import unicode_literals




admin.autodiscover()


sitemaps = {
    'posts': ExampleSitemap
}

urlpatterns = patterns(
    '',
    url(r'^sitemap\.xml$', sitemap,
        {'sitemaps': override_sitemaps_domain(sitemaps)},
        name='django.contrib.sitemaps.views.sitemap'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', IndexView.as_view(), name='homepage'),
    url(r'^error\.html$', ErrorView.as_view(), name='error_page'),
    url(r'^redirect/$', RedirectToHomeView.as_view(), name='redirect_home'),
    url(r'^posts/$', PostListView.as_view(), name='post_list'),

# Path: staticgen/sitemaps.py
# def override_sitemaps_domain(sitemaps):
#     staticgen_sitemaps = {}
#     for section, site in sitemaps.items():
#         cls_name = 'Staticgen{name}'.format(name=site.__name__)
#         staticgen_sitemaps[section] = type(cls_name, (StaticgenSitemap, site), {})
#     return staticgen_sitemaps
# 
# Path: example/views.py
# class ErrorView(TemplateView):
#     template_name = 'example/error.html'
# 
# class IndexView(TemplateView):
#     template_name = 'example/home.html'
# 
# class PostDetailView(DetailView):
#     model = Post
#     context_object_name = 'post'
#     template_name = 'example/post_detail.html'
# 
# class PostListView(ListView):
#     model = Post
#     paginate_by = 5
#     context_object_name = 'post_list'
#     template_name = 'example/post_list.html'
# 
# class RedirectToHomeView(RedirectView):
#     permanent = False
#     query_string = True
#     pattern_name = 'homepage'
# 
# Path: example/sitemaps.py
# class ExampleSitemap(Sitemap):
#     changefreq = 'never'
#     priority = 0.5
# 
#     def items(self):
#         return Post.objects.all()


# Path: example/urls.py
from django.conf.urls import patterns, url, include
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from staticgen.sitemaps import override_sitemaps_domain
from .views import ErrorView, IndexView, PostDetailView, PostListView, RedirectToHomeView
from .sitemaps import ExampleSitemap

# -*- coding: utf-8 -*-

from __future__ import unicode_literals




admin.autodiscover()


sitemaps = {
    'posts': ExampleSitemap
}

urlpatterns = patterns(
    '',
    url(r'^sitemap\.xml$', sitemap,
        {'sitemaps': override_sitemaps_domain(sitemaps)},
        name='django.contrib.sitemaps.views.sitemap'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', IndexView.as_view(), name='homepage'),
    url(r'^error\.html$', ErrorView.as_view(), name='error_page'),
    url(r'^redirect/$', RedirectToHomeView.as_view(), name='redirect_home'),
    url(r'^posts/$', PostListView.as_view(), name='post_list'),

    url(r'^posts/page/(?P<page>\d+)/$', PostListView.as_view(), name='post_list'),