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 django.views.generic import TemplateView 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 from syndication.views import FacebookFeedView import builder.views import utils.views from locations.views import MapDataList 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$', MapDataList.as_view(), name="mapdatalist" ), url (r'media/js/leaflet-providers.js', TemplateView.as_view(template_name='js/leaflet-providers.js') ), url(r'^media/admin/(?P.*)$', static.serve, {'document_root': settings.MEDIA_ROOT + '/admin'}), url(r'^media/(?P.*)$', static.serve, {'document_root': settings.MEDIA_ROOT}), ] from utils.views import TagAutocomplete urlpatterns += [ url( r'^tag-autocomplete/$', TagAutocomplete.as_view(), name='tag-autocomplete', ), url(r'^admin/build/.*', builder.views.do_build), url(r'^admin/', include(admin.site.urls),), url(r'^luximages/insert/', utils.views.insert_image), 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')), 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', namespace='map')), url( r'^$', HomepageList.as_view(), name="homepage" ), # facebook ia feed url(r'^iafeed.xml$', FacebookFeedView.as_view()), url(r'^comments/', include('django_comments.urls')), # 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, } ), ] if settings.DEBUG: import debug_toolbar urlpatterns = [ url(r'^__debug__/', include(debug_toolbar.urls)), ] + urlpatterns