diff options
-rw-r--r-- | app/birds/urls.py | 20 | ||||
-rw-r--r-- | app/books/urls.py | 12 | ||||
-rw-r--r-- | app/expenses/urls.py | 8 | ||||
-rw-r--r-- | app/figments/urls.py | 20 | ||||
-rw-r--r-- | app/guide/urls.py | 17 | ||||
-rw-r--r-- | app/income/admin.py | 12 | ||||
-rw-r--r-- | app/jrnl/urls.py | 42 | ||||
-rw-r--r-- | app/lib/django_comments/urls.py | 30 | ||||
-rw-r--r-- | app/links/urls.py | 26 | ||||
-rw-r--r-- | app/locations/urls.py | 12 | ||||
-rw-r--r-- | app/notes/urls.py | 31 | ||||
-rw-r--r-- | app/photos/admin.py | 19 | ||||
-rw-r--r-- | app/photos/detail_urls.py | 11 | ||||
-rw-r--r-- | app/photos/urls.py | 32 | ||||
-rw-r--r-- | app/projects/urls.py | 34 | ||||
-rw-r--r-- | app/resume/urls.py | 20 | ||||
-rw-r--r-- | app/src/urls.py | 32 | ||||
-rw-r--r-- | config/base_urls.py | 99 |
18 files changed, 264 insertions, 213 deletions
diff --git a/app/birds/urls.py b/app/birds/urls.py index 017ce39..8b1618c 100644 --- a/app/birds/urls.py +++ b/app/birds/urls.py @@ -4,29 +4,29 @@ from . import views urlpatterns = [ url( - regex=r'(?P<user>[\w]+)/(?P<page>\d+)/', - view=views.BirdListUserView.as_view(), + r'(?P<user>[\w]+)/(?P<page>\d+)/', + views.BirdListUserView.as_view(), name='list_by_person' ), url( - regex=r'(?P<page>\d+)/$', - view=views.BirdListView.as_view(), + r'(?P<page>\d+)/$', + views.BirdListView.as_view(), name="list" ), url( - regex=r'^(?P<slug>[-_\w]+)$', - view=views.BirdDetailView.as_view(), + r'^(?P<slug>[-_\w]+)$', + views.BirdDetailView.as_view(), name='detail' ), # redirect /slug/ to /slug/1/ for live server url( - regex=r'(?P<user>[-\w]+)/$', - view=RedirectView.as_view(url="/birds/%(user)s/1/", permanent=False), + r'(?P<user>[-\w]+)/$', + RedirectView.as_view(url="/birds/%(user)s/1/", permanent=False), name="list_person_redirect" ), url( - regex=r'', - view=RedirectView.as_view(url="/birds/1/", permanent=False), + r'', + RedirectView.as_view(url="/birds/1/", permanent=False), name="list_redirect" ), ] diff --git a/app/books/urls.py b/app/books/urls.py index 6c172aa..c05fed7 100644 --- a/app/books/urls.py +++ b/app/books/urls.py @@ -5,18 +5,18 @@ from . import views urlpatterns = [ url( - regex=r'(?P<page>\d+)/$', - view=views.BookListView.as_view(), + r'(?P<page>\d+)/$', + views.BookListView.as_view(), name='list', ), url( - regex=r'(?P<slug>[-\w]+)/$', - view=views.BookDetailView.as_view(), + r'(?P<slug>[-\w]+)/$', + views.BookDetailView.as_view(), name='detail', ), url( - regex=r'^$', - view=RedirectView.as_view(url="/books/1/", permanent=False), + r'^$', + RedirectView.as_view(url="/books/1/", permanent=False), name="live-redirect" ), ] diff --git a/app/expenses/urls.py b/app/expenses/urls.py index a2cf35a..698ac07 100644 --- a/app/expenses/urls.py +++ b/app/expenses/urls.py @@ -4,13 +4,13 @@ from . import views urlpatterns = [ url( - regex=r'(?P<slug>[-\w]+)$', - view=views.ExpenseListView.as_view(), + r'(?P<slug>[-\w]+)$', + views.ExpenseListView.as_view(), name='list_expense' ), url( - regex=r'^$', - view=views.TripListView.as_view(), + r'^$', + views.TripListView.as_view(), name='list_trip' ) ] diff --git a/app/figments/urls.py b/app/figments/urls.py index 2114792..9e624aa 100644 --- a/app/figments/urls.py +++ b/app/figments/urls.py @@ -4,28 +4,28 @@ from . import views urlpatterns = [ url( - regex=r'^feed.xml', - view=views.FigRSSFeedView(), + r'^feed.xml', + views.FigRSSFeedView(), name="feed" ), url( - regex=r'series/$', - view=views.SeriesListView.as_view(), + r'series/$', + views.SeriesListView.as_view(), name='list_series' ), url( - regex=r'(?P<slug>[-\w]+).txt$', - view=views.FigmentDetailViewTXT.as_view(), + r'(?P<slug>[-\w]+).txt$', + views.FigmentDetailViewTXT.as_view(), name="detail-txt" ), url( - regex=r'(?P<slug>[-\w]+)$', - view=views.FigmentDetailView.as_view(), + r'(?P<slug>[-\w]+)$', + views.FigmentDetailView.as_view(), name='detail' ), url( - regex=r'^$', - view=views.FigmentListView.as_view(), + r'^$', + views.FigmentListView.as_view(), name='list' ), ] diff --git a/app/guide/urls.py b/app/guide/urls.py index 52222fd..e701d3e 100644 --- a/app/guide/urls.py +++ b/app/guide/urls.py @@ -1,12 +1,13 @@ from django.conf.urls import * from django.views.generic.base import RedirectView +from . import views -urlpatterns = patterns('', - (r'location/(?P<location>[-\w]+)/(?P<slug>[-\w]+)/$', 'guide.views.guide_detail'), - (r'location/(?P<location>[-\w]+)/$', 'guide.views.guide_list_by_location'), - (r'location/$', 'guide.views.location_list'), - (r'(?P<page>\d+)/$', 'guide.views.guide_list'), - (r'(?P<slug>[-\w]+)/$', 'guide.views.guide_detail'), - (r'', RedirectView.as_view(url="/travel-guide/1/")), -) +urlpatterns = [ + url(r'location/(?P<location>[-\w]+)/(?P<slug>[-\w]+)/$', views.guide_detail), + url(r'location/(?P<location>[-\w]+)/$', views.guide_list_by_location), + url(r'location/$', views.location_list), + url(r'(?P<page>\d+)/$', views.guide_list), + url(r'(?P<slug>[-\w]+)/$', views.guide_detail), + url(r'', RedirectView.as_view(url="/travel-guide/1/")), +] diff --git a/app/income/admin.py b/app/income/admin.py index df93011..2483e1f 100644 --- a/app/income/admin.py +++ b/app/income/admin.py @@ -35,11 +35,13 @@ class GigAdmin(OSMGeoAdmin): def get_urls(self): urls = super(GigAdmin, self).get_urls() - custom_urls = patterns('', - url(r'^monthly/$', - self.admin_site.admin_view(self.get_monthly), - name='monthly_admin') - ) + custom_urls = [ + url( + r'^monthly/$', + self.admin_site.admin_view(self.get_monthly), + name='monthly_admin' + ) + ] return custom_urls + urls def get_monthly(self, request): diff --git a/app/jrnl/urls.py b/app/jrnl/urls.py index 09c7b7c..c1cdcdc 100644 --- a/app/jrnl/urls.py +++ b/app/jrnl/urls.py @@ -3,57 +3,59 @@ from django.views.generic.base import RedirectView from . import views +app_name = "jrnl" + urlpatterns = [ url( - regex=r'^feed.xml', - view=views.JrnlRSSFeedView(), + r'^feed.xml', + views.JrnlRSSFeedView(), name="feed" ), url( - regex=r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$', - view=views.EntryDetailViewTXT.as_view(), + r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$', + views.EntryDetailViewTXT.as_view(), name="detail-txt" ), url( - regex=r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).amp$', - view=views.EntryDetailViewAMP.as_view(), + r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).amp$', + views.EntryDetailViewAMP.as_view(), name="detail-amp" ), url( - regex=r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$', - view=views.EntryDetailView.as_view(), + r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$', + views.EntryDetailView.as_view(), name="detail" ), url( - regex=r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', - view=views.EntryMonthArchiveView.as_view(month_format='%m'), + r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', + views.EntryMonthArchiveView.as_view(month_format='%m'), name="list_month" ), url( - regex=r'(?P<year>\d{4})/$', - view=views.EntryYearArchiveView.as_view(), + r'(?P<year>\d{4})/$', + views.EntryYearArchiveView.as_view(), name="list_year" ), url( - regex=r'(?P<slug>[-\w]+)/(?P<page>\d+)/$', - view=views.EntryCountryList.as_view(), + r'(?P<slug>[-\w]+)/(?P<page>\d+)/$', + views.EntryCountryList.as_view(), name="list_country" ), url( - regex=r'(?P<page>\d+)/$', - view=views.EntryList.as_view(), + r'(?P<page>\d+)/$', + views.EntryList.as_view(), name="list" ), # redirect /slug/ to /slug/1/ for live server url( - regex=r'(?P<slug>[-\w]+)/$', - view=RedirectView.as_view(url="/jrnl/%(slug)s/1/", permanent=False), + r'(?P<slug>[-\w]+)/$', + RedirectView.as_view(url="/jrnl/%(slug)s/1/", permanent=False), name="live_location_redirect" ), # redirect / to /1/ for live server url( - regex=r'', - view=RedirectView.as_view(url="/jrnl/1/", permanent=False), + r'', + RedirectView.as_view(url="/jrnl/1/", permanent=False), name="live_redirect" ), ] diff --git a/app/lib/django_comments/urls.py b/app/lib/django_comments/urls.py index e02bab0..fb8f972 100644 --- a/app/lib/django_comments/urls.py +++ b/app/lib/django_comments/urls.py @@ -1,16 +1,18 @@ -from django.conf.urls import patterns, url +from django.conf.urls import url +from .views import comments, moderation +from django.contrib.contenttypes.views import shortcut -urlpatterns = patterns('django_comments.views', - url(r'^post/$', 'comments.post_comment', name='comments-post-comment'), - url(r'^posted/$', 'comments.comment_done', name='comments-comment-done'), - url(r'^flag/(\d+)/$', 'moderation.flag', name='comments-flag'), - url(r'^flagged/$', 'moderation.flag_done', name='comments-flag-done'), - url(r'^delete/(\d+)/$', 'moderation.delete', name='comments-delete'), - url(r'^deleted/$', 'moderation.delete_done', name='comments-delete-done'), - url(r'^approve/(\d+)/$', 'moderation.approve', name='comments-approve'), - url(r'^approved/$', 'moderation.approve_done', name='comments-approve-done'), -) +urlpatterns = [ + url(r'^post/$', comments.post_comment, name='comments-post-comment'), + url(r'^posted/$', comments.comment_done, name='comments-comment-done'), + url(r'^flag/(\d+)/$', moderation.flag, name='comments-flag'), + url(r'^flagged/$', moderation.flag_done, name='comments-flag-done'), + url(r'^delete/(\d+)/$', moderation.delete, name='comments-delete'), + url(r'^deleted/$', moderation.delete_done, name='comments-delete-done'), + url(r'^approve/(\d+)/$', moderation.approve, name='comments-approve'), + url(r'^approved/$', moderation.approve_done, name='comments-approve-done'), +] -urlpatterns += patterns('', - url(r'^cr/(\d+)/(.+)/$', 'django.contrib.contenttypes.views.shortcut', name='comments-url-redirect'), -) +urlpatterns += [ + url(r'^cr/(\d+)/(.+)/$', shortcut, name='comments-url-redirect'), +] diff --git a/app/links/urls.py b/app/links/urls.py index 5fdaf30..6f9bf22 100644 --- a/app/links/urls.py +++ b/app/links/urls.py @@ -3,35 +3,37 @@ from django.views.generic.base import RedirectView from . import views +app_name = "links" + urlpatterns = [ url( - regex=r'tag/(?P<slug>[-\w]+)/(?P<page>\d+)/$', - view=views.LinkTagListView.as_view(), + r'tag/(?P<slug>[-\w]+)/(?P<page>\d+)/$', + views.LinkTagListView.as_view(), name='list-tag' ), url( - regex=r'(?P<slug>[-\d]+).txt$', - view=views.LinkDetailViewTXT.as_view(), + r'(?P<slug>[-\d]+).txt$', + views.LinkDetailViewTXT.as_view(), name="detail-txt" ), url( - regex=r'(?P<slug>[-\d]+)$', - view=views.LinkDetailView.as_view(), + r'(?P<slug>[-\d]+)$', + views.LinkDetailView.as_view(), name='detail' ), url( - regex=r'(?P<page>\d+)/$', - view=views.LinkListView.as_view(), + r'(?P<page>\d+)/$', + views.LinkListView.as_view(), name='list' ), url( - regex=r'^tag/(?P<slug>[-\w]+)/$', - view=RedirectView.as_view(url="/links/tag/%(slug)s/1/", permanent=False), + r'^tag/(?P<slug>[-\w]+)/$', + RedirectView.as_view(url="/links/tag/%(slug)s/1/", permanent=False), name="live-redirect-tag" ), url( - regex=r'^$', - view=RedirectView.as_view(url="/links/1/", permanent=False), + r'^$', + RedirectView.as_view(url="/links/1/", permanent=False), name="live-redirect" ), ] diff --git a/app/locations/urls.py b/app/locations/urls.py index c7ddb74..77f9f0c 100644 --- a/app/locations/urls.py +++ b/app/locations/urls.py @@ -1,6 +1,8 @@ -from django.conf.urls import * +from django.conf.urls import url -urlpatterns = patterns('', - (r'data/(?P<id>\d+)/$', 'locations.views.data_json'), - (r'^$', 'locations.views.map_list'), -) +from . import views + +urlpatterns = [ + url(r'data/(?P<id>\d+)/$', views.data_json), + url(r'^$', views.map_list), +] diff --git a/app/notes/urls.py b/app/notes/urls.py index 9018553..2bec08f 100644 --- a/app/notes/urls.py +++ b/app/notes/urls.py @@ -1,8 +1,25 @@ -from django.conf.urls import patterns, url +from django.conf.urls import url -urlpatterns = patterns('', - url(r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$', 'notes.views.entry_detail'), - url(r'(?P<year>\d{4})/(?P<month>\d{2})/$', 'notes.views.date_list', name="notes_by_month"), - url(r'(?P<year>\d{4})/$', 'notes.views.date_list', name="notes_by_year"), - url(r'^$', 'notes.views.entry_list', name="notes_archive"), -) +from . import views + +urlpatterns = [ + url( + r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$', + views.entry_detail + ), + url( + r'(?P<year>\d{4})/(?P<month>\d{2})/$', + views.date_list, + name="notes_by_month" + ), + url( + r'(?P<year>\d{4})/$', + views.date_list, + name="notes_by_year" + ), + url( + r'^$', + views.entry_list, + name="notes_archive" + ), +] diff --git a/app/photos/admin.py b/app/photos/admin.py index 2f71fcc..8b1d723 100644 --- a/app/photos/admin.py +++ b/app/photos/admin.py @@ -11,24 +11,28 @@ from django.http import HttpResponseRedirect from .forms import UploadZipForm + class LuxImageAdmin(OSMGeoAdmin): - list_display = ('pk','admin_thumbnail', 'pub_date',) + list_display = ('pk', 'admin_thumbnail', 'pub_date',) list_filter = ('pub_date',) search_fields = ['title', 'caption'] admin.site.register(LuxImage, LuxImageAdmin) + class GalleryAdmin(OSMGeoAdmin): list_display = ('title', 'location', 'pub_date') list_filter = ('location',) - + def get_urls(self): urls = super(GalleryAdmin, self).get_urls() - custom_urls = patterns('', - url(r'^upload_zip/$', - self.admin_site.admin_view(self.upload_zip), - name='upload_zip') - ) + custom_urls = [ + url( + r'^upload_zip/$', + self.admin_site.admin_view(self.upload_zip), + name='upload_zip' + ) + ] return custom_urls + urls def upload_zip(self, request): @@ -55,6 +59,7 @@ class GalleryAdmin(OSMGeoAdmin): admin.site.register(Gallery, GalleryAdmin) + class PhotoAdmin(OSMGeoAdmin): list_display = ('title', 'admin_thumbnail', 'flickr_id', 'pub_date',) list_filter = ('pub_date',) diff --git a/app/photos/detail_urls.py b/app/photos/detail_urls.py index 8bdbd79..0ab94f6 100644 --- a/app/photos/detail_urls.py +++ b/app/photos/detail_urls.py @@ -1,7 +1,10 @@ -from django.conf.urls import * +from django.conf.urls import url from django.views.generic.detail import DetailView from photos.models import Photo -urlpatterns = patterns('', - (r'^(?P<object_id>\d+)/$', DetailView.as_view(model=Photo, template_name='details/photo.html')), -) +urlpatterns = [ + url( + r'^(?P<object_id>\d+)/$', + DetailView.as_view(model=Photo, template_name='details/photo.html') + ), +] diff --git a/app/photos/urls.py b/app/photos/urls.py index 91aac41..7d074a9 100644 --- a/app/photos/urls.py +++ b/app/photos/urls.py @@ -1,11 +1,27 @@ -from django.conf.urls import * +from django.conf.urls import url from django.views.generic.base import RedirectView +from . import views -urlpatterns = patterns('', - (r'data/(?P<slug>[-\w]+)/$', 'photos.views.photo_json'), - (r'galleries/(?P<slug>[-\w]+)/$', 'photos.views.gallery'), - (r'(?P<page>\d+)/$', 'photos.views.gallery_list'), - (r'(?P<slug>[-\w]+)/$', RedirectView.as_view(url="/photos/%(slug)s/1/", permanent=False)), - (r'', RedirectView.as_view(url="/photos/1/", permanent=False)), -) +urlpatterns = [ + url( + r'data/(?P<slug>[-\w]+)/$', + views.photo_json + ), + url( + r'galleries/(?P<slug>[-\w]+)/$', + views.gallery, + ), + url( + r'(?P<page>\d+)/$', + views.gallery_list, + ), + url( + r'(?P<slug>[-\w]+)/$', + RedirectView.as_view(url="/photos/%(slug)s/1/", permanent=False) + ), + url( + r'', + RedirectView.as_view(url="/photos/1/", permanent=False) + ), +] diff --git a/app/projects/urls.py b/app/projects/urls.py index f826624..97a7129 100644 --- a/app/projects/urls.py +++ b/app/projects/urls.py @@ -1,14 +1,28 @@ -from django.conf.urls import * +from django.conf.urls import url from django.views.generic import ListView from projects.models.base import Project +from . import views -urlpatterns = patterns('', - (r'data/(?P<id>\d+)/$', 'projects.views.data_json'), - (r'gifs/(?P<slug>[-\w]+)/$', 'projects.views.gif_detail'), - (r'(?P<slug>[-\w]+)/$', 'projects.views.detail'), - (r'^$', ListView.as_view( - queryset=Project.objects.filter(status__exact=1).order_by('-pub_date'), - template_name="archives/projects.html", - )), -) + +urlpatterns = [ + url( + r'data/(?P<id>\d+)/$', + views.data_json + ), + url( + r'gifs/(?P<slug>[-\w]+)/$', + views.gif_detail + ), + url( + r'(?P<slug>[-\w]+)/$', + views.detail + ), + url( + r'^$', + ListView.as_view( + queryset=Project.objects.filter(status__exact=1).order_by('-pub_date'), + template_name="archives/projects.html", + ) + ), +] diff --git a/app/resume/urls.py b/app/resume/urls.py index a359899..3e113e8 100644 --- a/app/resume/urls.py +++ b/app/resume/urls.py @@ -5,28 +5,28 @@ from . import views urlpatterns = [ url( - regex=r'pubs/(?P<page>\d+)/$', - view=views.PublisherListView.as_view(), + r'pubs/(?P<page>\d+)/$', + views.PublisherListView.as_view(), name='list', ), url( - regex=r'pubs/(?P<publisher>[-\w]+)/(?P<slug>[-\w]+)$', - view=views.PubItemDetailView.as_view(), + r'pubs/(?P<publisher>[-\w]+)/(?P<slug>[-\w]+)$', + views.PubItemDetailView.as_view(), name='detail', ), url( - regex=r'pubs/$', - view=RedirectView.as_view(url="/resume/pubs/1/", permanent=False), + r'pubs/$', + RedirectView.as_view(url="/resume/pubs/1/", permanent=False), name="live-redirect" ), url( - regex=r'^(?P<slug>[-\w]+)$', - view=views.PageView.as_view(), + r'^(?P<slug>[-\w]+)$', + views.PageView.as_view(), name="cv" ), url( - regex=r'^$', - view=views.BaseView.as_view(), + r'^$', + views.BaseView.as_view(), name="intro" ), ] diff --git a/app/src/urls.py b/app/src/urls.py index 217912c..37e4774 100644 --- a/app/src/urls.py +++ b/app/src/urls.py @@ -5,8 +5,8 @@ from . import views urlpatterns = [ url( - regex=r'^feed.xml', - view=views.SrcRSSFeedView(), + r'^feed.xml', + views.SrcRSSFeedView(), name="feed" ), url( @@ -15,38 +15,38 @@ urlpatterns = [ name="paypal-ipn" ), url( - regex=r'topic/(?P<slug>[-\w]+)$', - view=views.TopicListView.as_view(), + r'topic/(?P<slug>[-\w]+)$', + views.TopicListView.as_view(), name="list_topics" ), url( - regex=r'books/(?P<slug>[-\w]+)$', - view=views.BookDetailView.as_view(), + r'books/(?P<slug>[-\w]+)$', + views.BookDetailView.as_view(), name='detail_book' ), url( - regex=r'books/$', - view=views.BookListView.as_view(), + r'books/$', + views.BookListView.as_view(), name='list_books' ), url( - regex=r'(?P<slug>[-\w]+).txt$', - view=views.EntryDetailViewTXT.as_view(), + r'(?P<slug>[-\w]+).txt$', + views.EntryDetailViewTXT.as_view(), name="detail-txt" ), url( - regex=r'(?P<slug>[-\w]+).amp$', - view=views.EntryDetailViewAMP.as_view(), + r'(?P<slug>[-\w]+).amp$', + views.EntryDetailViewAMP.as_view(), name="detail-amp" ), url( - regex=r'(?P<slug>[-\w]+)$', - view=views.EntryDetailView.as_view(), + r'(?P<slug>[-\w]+)$', + views.EntryDetailView.as_view(), name="detail" ), url( - regex=r'^$', - view=views.SrcListView.as_view(), + r'^$', + views.SrcListView.as_view(), name="list", ), ] diff --git a/config/base_urls.py b/config/base_urls.py index 4cb56ab..d67afe2 100644 --- a/config/base_urls.py +++ b/config/base_urls.py @@ -1,6 +1,7 @@ from django.conf.urls import * from django.contrib import admin from django.views.generic import TemplateView +from django.views import static from django.conf import settings from jrnl.models import BlogSitemap @@ -10,11 +11,11 @@ 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, @@ -23,88 +24,72 @@ sitemaps = { 'src': SrcSitemap } -urlpatterns = patterns('', +urlpatterns = [ (r'^projects/data/natparks/(?P<path>.*)$', '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<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT + '/admin'}), (r'^media/(?P<path>.*)$', '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<url>.*)/$', '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}), - url( - regex=r'^links/', - view=include('links.urls', namespace='links') - ), +urlpatterns += [ + url(r'^admin/build/.*', builder.views.do_build), + url(r'^admin/', include(admin.site.urls),), + url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}), + url(r'^links/', include('links.urls')), + url(r'^jrnl/', include('jrnl.urls')), + url(r'^projects/', include('projects.urls')), url( - regex=r'^jrnl/', - view=include('jrnl.urls', namespace='jrnl') + r'^locations/', + include('locations.urls') ), - (r'^projects/', include('projects.urls')), - (r'^locations/', include('locations.urls')), url( - regex=r'^expenses/', - view=include('expenses.urls', namespace='expenses') + r'^expenses/', + include('expenses.urls', namespace='expenses') ), (r'^photos/', include('photos.urls')), url( - regex=r'^books/', - view=include('books.urls', namespace='books') + r'^books/', + include('books.urls', namespace='books') ), url( - regex=r'^field-notes/', - view=include('notes.urls', namespace='notes') + r'^field-notes/', + include('notes.urls', namespace='notes') ), url( - regex=r'^photo/', - view=include('photos.detail_urls', namespace='photos') + r'^photo/', + include('photos.detail_urls', namespace='photos') ), url( - regex=r'^birds/', - view=include('birds.urls', namespace='birds') + r'^birds/', + include('birds.urls', namespace='birds') ), - (r'^travel-guide/', include('guide.urls')), - (r'^src/', include('src.urls', namespace='src')), + url(r'^travel-guide/', include('guide.urls')), + url(r'^src/', include('src.urls', namespace='src')), url( - regex=r'^figments/', - view=include('figments.urls', namespace='figments') + r'^figments/', + include('figments.urls', namespace='figments') ), url( - regex=r'^resume/', - view=include('resume.urls', namespace='resume') + r'^resume/', + include('resume.urls', namespace='resume') ), - (r'^map/', include('locations.urls')), + url(r'^map', include('locations.urls')), url( - regex=r'^$', - view=HomepageList.as_view(), + r'^$', + HomepageList.as_view(), name="homepage" ), - #pages - (r'^(?P<slug>[-\w]+)/?$', 'pages.views.page'), - -) + # pages + url(r'^(?P<slug>[-\w]+)/?$', 'pages.views.page'), +] -urlpatterns += patterns('', - url(r'^static/(?P<path>.*)$', 'django.views.static.serve', +urlpatterns += [ + url( + r'^static/(?P<path>.*)$', + static.serve, {'document_root': settings.STATIC_ROOT, } ), -) -urlpatterns += patterns('', +] +urlpatterns += [ (r'^comments/', include('django_comments.urls')), - #url(r'^comments/', include('django_comments_xtd.urls')) - #url(r'^comments/', include('fluent_comments.urls')), -) +] |