# HG changeset patch # User Brian Neal # Date 1394306350 21600 # Node ID c962f58c269344bd5f84ddc49cebd9e4454bd926 # Parent fc86604ea0ad0b1260a8cd00123e930fd6c4eb16 Support photologue photo detail views to prevent 404s in the admin. diff -r fc86604ea0ad -r c962f58c2693 madeira/urls.py --- a/madeira/urls.py Fri Feb 14 19:42:42 2014 -0600 +++ b/madeira/urls.py Sat Mar 08 13:19:10 2014 -0600 @@ -1,8 +1,12 @@ from django.conf.urls import patterns, include, url from django.contrib import admin +from django.contrib.admin.views.decorators import staff_member_required from django.conf.urls.static import static from django.conf import settings -from django.views.generic import TemplateView +from django.views.generic import DetailView, TemplateView + +from photologue.models import Photo + admin.autodiscover() @@ -26,6 +30,13 @@ (r'^reset/(?P[0-9A-Za-z]+)-(?P.+)/$', 'django.contrib.auth.views.password_reset_confirm'), (r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'), + + # Keeping photologue on life support: + url(r'^photo/(?P[\-\d\w]+)/$', + staff_member_required(DetailView.as_view(model=Photo, + slug_field='title_slug')), + name='pl-photo'), + (r'^admin/', include(admin.site.urls)), ) diff -r fc86604ea0ad -r c962f58c2693 photologue/templates/photologue/photo_detail.html --- a/photologue/templates/photologue/photo_detail.html Fri Feb 14 19:42:42 2014 -0600 +++ b/photologue/templates/photologue/photo_detail.html Sat Mar 08 13:19:10 2014 -0600 @@ -6,7 +6,7 @@

{{ object.title }}

{% if object.public_galleries %}