from django.conf.urls.defaults import * from django.contrib import admin from django.views.generic import list_detail from django.views.generic.simple import redirect_to,direct_to_template from django.contrib.sitemaps import FlatPageSitemap from django.conf import settings from blog.models import BlogSitemap,LatestFull from locations.models import WritingbyLocationSitemap from links.models import LatestLinks admin.autodiscover() sitemaps = { 'blog': BlogSitemap, 'flatpages': FlatPageSitemap, #'locations': WritingbyLocationSitemap } feeds = { 'writing': LatestFull, 'fblinks' : LatestLinks, } # old page redirects urlpatterns = patterns('', (r'^2003/nov/02/take-me-your-leader-ii/$', direct_to_template, {'template': 'static/oldcontent.html'}), (r'^2003/aug/07/take-me-your-leader/$', direct_to_template, {'template': 'static/oldcontent.html'}), (r'^2004/jan/07/david-foster-wallace-infinity/$', direct_to_template, {'template': 'static/oldcontent.html'}), ) if settings.DEVELOPMENT: urlpatterns = patterns('', (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': '/Users/lux/Sites/luxagraf/media'}), (r'^images/(?P.*)$', 'django.views.static.serve', {'document_root': '/Users/lux/Sites/luxagraf/images'}), ) urlpatterns += patterns('', (r'^uploads/', include('upload.urls')), (r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}), (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/(.*)', admin.site.root), (r'^robots.txt$', direct_to_template, {'template': 'archives/robots.html'}), (r'^googleb11655cd59dacf3c.html$', direct_to_template, {'template': 'static/gverify.html'}), (r'^contact/', include('contact_form.urls')), #(r'^photo-of-the-day/$', 'luxagraf.photos.views.potd_list'), (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}), (r'^writing/', include('blog.urls')), #Entry detail i.e. /year/month/day/my-title/ (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'^photos/', include('photos.urls')), (r'^photo/', include('photos.detail_urls')), # map (r'^map/', include('locations.urls')), #homepage (r'^$', 'blog.views.home'), #'blog.views.home'), #static pages #(r'(?P[-\w]+)/$', 'static.views.page_view'), )