from django.conf.urls import * from django.contrib import admin from django.views.generic import TemplateView from django.conf import settings from blog.models import BlogSitemap, LatestFull from locations.models import WritingbyCountrySitemap from links.models import LatestLinks from photos.models import PhotoGallerySitemap from projects.models.base import ProjectSitemap admin.autodiscover() sitemaps = { 'blog': BlogSitemap, 'writingbyloc': WritingbyCountrySitemap, 'photos': PhotoGallerySitemap, 'projects': ProjectSitemap } feeds = { 'writing': LatestFull, 'fblinks': LatestLinks, } urlpatterns = patterns('', (r'^projects/data/natparks/(?P.*)$', 'django.views.static.serve', {'document_root': settings.PROJ_ROOT + 'site/projects/data/natparks/'}), (r'^media/js/mainmap.js$', 'locations.views.map_data'), (r'^media/admin/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT + '/admin'}), (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) # old page redirects urlpatterns += patterns('', (r'^2003/nov/02/take-me-your-leader-ii/$', TemplateView.as_view(template_name='static/oldcontent.html')), (r'^2003/aug/07/take-me-your-leader/$', TemplateView.as_view(template_name='static/oldcontent.html')), (r'^2004/jan/07/david-foster-wallace-infinity/$', TemplateView.as_view(template_name='static/oldcontent.html')), ) urlpatterns += patterns('', (r'^admin/build/.*', 'builder.views.do_build'), (r'^admin/', include(admin.site.urls),), #(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}), (r'^robots.txt$', TemplateView.as_view(template_name='archives/robots.html')), (r'^arctest$', TemplateView.as_view(template_name='arctest.html')), (r'^googleb11655cd59dacf3c.html$', TemplateView.as_view(template_name='static/gverify.html')), #(r'^contact/', TemplateView.as_view(template_name='details/contact.html')), (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}), (r'^jrnl/', include('blog.urls')), (r'^projects/', include('projects.urls')), #Entry detail i.e. /year/month/day/my-title/ #old: (r'(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?P[-\w]+)/$', 'blog.views.entry_detail'), # locations (r'^locations/', include('locations.urls')), (r'^expenses/', include('expenses.urls')), (r'^photos/', include('photos.urls')), (r'^books/', include('books.urls')), (r'^field-notes/', include('notes.urls')), (r'^photo/', include('photos.detail_urls')), (r'^birds/', include('birds.urls')), (r'^travel-guide/', include('guide.urls')), (r'^src/', include('src.urls')), # map (r'^map/', include('locations.urls')), #about #(r'^about/$', 'blog.views.about'), #'blog.views.home'), #homepage (r'^$', 'blog.views.home'), #pages (r'^(?P[-\w]+)/?$', 'pages.views.page'), ) urlpatterns += patterns('', url(r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT, } ), ) urlpatterns += patterns('', (r'^comments/', include('django_comments.urls')), #url(r'^comments/', include('django_comments_xtd.urls')) #url(r'^comments/', include('fluent_comments.urls')), )