diff 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
line wrap: on
line diff
--- a/user_photos/urls.py	Sat Sep 14 18:43:10 2013 -0500
+++ b/user_photos/urls.py	Sun Sep 15 15:13:02 2013 -0500
@@ -3,11 +3,15 @@
 from django.views.generic import DetailView
 
 from user_photos.models import Photo
+from user_photos.views import GalleryView
 
 
-urlpatterns = patterns('user_photos.views',
-    url(r'^upload/$', 'upload', name='user_photos-upload'),
+urlpatterns = patterns('',
+    url(r'^upload/$', 'user_photos.views.upload', name='user_photos-upload'),
     url(r'^photo/(?P<pk>\d+)/$',
         DetailView.as_view(model=Photo),
-        name='user_photos-detail')
+        name='user_photos-detail'),
+    url(r'^gallery/(?P<username>[\w.@+-]{1,30})/$',
+        GalleryView.as_view(),
+        name='user_photos-gallery'),
 )