comparison user_photos/urls.py @ 704:809d27b385f2

For user uploaded photos (#50), add a simple gallery view.
author Brian Neal <bgneal@gmail.com>
date Sun, 15 Sep 2013 15:13:02 -0500
parents b2a8fde3173a
children 13a1713d05b5
comparison
equal deleted inserted replaced
703:d7a0aaabc06c 704:809d27b385f2
1 """URLs for the user_photos application.""" 1 """URLs for the user_photos application."""
2 from django.conf.urls import patterns, url 2 from django.conf.urls import patterns, url
3 from django.views.generic import DetailView 3 from django.views.generic import DetailView
4 4
5 from user_photos.models import Photo 5 from user_photos.models import Photo
6 from user_photos.views import GalleryView
6 7
7 8
8 urlpatterns = patterns('user_photos.views', 9 urlpatterns = patterns('',
9 url(r'^upload/$', 'upload', name='user_photos-upload'), 10 url(r'^upload/$', 'user_photos.views.upload', name='user_photos-upload'),
10 url(r'^photo/(?P<pk>\d+)/$', 11 url(r'^photo/(?P<pk>\d+)/$',
11 DetailView.as_view(model=Photo), 12 DetailView.as_view(model=Photo),
12 name='user_photos-detail') 13 name='user_photos-detail'),
14 url(r'^gallery/(?P<username>[\w.@+-]{1,30})/$',
15 GalleryView.as_view(),
16 name='user_photos-gallery'),
13 ) 17 )