from django.urls import path, re_path, include from django.contrib import admin from django.conf.urls.static import static from django.conf import settings from django.contrib.sitemaps.views import sitemap from pages.views import PageDetailView from pages.models import PageSitemap from blog.views import HomePageView from blog.models import BlogSitemap from tutorials.models import TutorialSitemap from links.models import LinkedSitemap #import builder.views import utils.views import builder.views sitemaps = { 'blog': BlogSitemap, 'links': LinkedSitemap, 'pages': PageSitemap, 'tutorials': TutorialSitemap, } admin.autodiscover() urlpatterns = [ re_path(r'^admin/build/.*', builder.views.do_build), path(r'admin/data/', include('utils.urls')), path(r'admin/', admin.site.urls), path(r'luximages/insert/', utils.views.insert_image), path(r'sitemap.xml', sitemap, {'sitemaps': sitemaps}), path(r'essays/', include('blog.urls')), path(r'tutorials/', include('tutorials.urls')), path(r'linked/', include('links.urls')), path(r'comments/', include('django_comments.urls')), path(r'', PageDetailView.as_view()), path(r'//', PageDetailView.as_view()), path(r'', HomePageView.as_view()), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) if settings.DEBUG: import debug_toolbar urlpatterns = [ path('__debug__/', include(debug_toolbar.urls)), # For django versions before 2.0: # url(r'^__debug__/', include(debug_toolbar.urls)), ] + urlpatterns