from django.conf.urls import url from django.views.generic.detail import DetailView from photos.models import Photo urlpatterns = [ url( r'^(?P\d+)/$', DetailView.as_view(model=Photo, template_name='details/photo.html') ), ]