from django.conf.urls import url, include from django.contrib import admin from django.views import static from django.conf import settings from django.contrib.sitemaps.views import sitemap from pages.views import page from pages.views import PageDetailView from jrnl.models import BlogSitemap from jrnl.views import HomepageList from locations.models import WritingbyCountrySitemap from locations.views import map_data from photos.models import PhotoGallerySitemap from src.models import SrcSitemap from figments.models import FigmentSitemap from projects.models.base import ProjectSitemap import builder.views admin.autodiscover() sitemaps = { 'blog': BlogSitemap, 'writingbyloc': WritingbyCountrySitemap, 'photos': PhotoGallerySitemap, 'projects': ProjectSitemap, 'src': SrcSitemap } urlpatterns = [ url(r'^projects/data/natparks/(?P.*)$', static.serve, {'document_root': settings.PROJ_ROOT + 'site/projects/data/natparks/'}), url(r'^media/js/mainmap.js$', map_data), url(r'^media/admin/(?P.*)$', static.serve, {'document_root': settings.MEDIA_ROOT + '/admin'}), url(r'^media/(?P.*)$', static.serve, {'document_root': settings.MEDIA_ROOT}), ] urlpatterns += [ url(r'^admin/build/.*', builder.views.do_build), url(r'^admin/', include(admin.site.urls),), url(r'^sitemap.xml$', sitemap, {'sitemaps': sitemaps}), url(r'^links/', include('links.urls')), url(r'^jrnl/', include('jrnl.urls')), url(r'^projects/', include('projects.urls')), url(r'^locations/', include('locations.urls')), url(r'^expenses/', include('expenses.urls', namespace='expenses')), url(r'^photos/', include('photos.urls')), url(r'^books/', include('books.urls')), url( r'^field-notes/', include('notes.urls', namespace='notes') ), url( r'^birds/', include('birds.urls', namespace='birds') ), url(r'^travel-guide/', include('guide.urls')), url(r'^src/', include('src.urls', namespace='src')), url(r'^figments/', include('figments.urls', namespace='figments')), url(r'^resume/', include('resume.urls', namespace='resume')), url(r'^map', include('locations.urls')), url( r'^$', HomepageList.as_view(), name="homepage" ), # pages url(r'^(?P[-\w]+)/?$', PageDetailView.as_view()), url(r'^(?P[-\w]+)/(?P[-\w]+)?$', PageDetailView.as_view()), ] urlpatterns += [ url( r'^static/(?P.*)$', static.serve, {'document_root': settings.STATIC_ROOT, } ), ] urlpatterns += [ url(r'^comments/', include('django_comments.urls')), ]