annotate 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 |
rev |
line source |
bgneal@695
|
1 """URLs for the user_photos application."""
|
bgneal@695
|
2 from django.conf.urls import patterns, url
|
bgneal@696
|
3 from django.views.generic import DetailView
|
bgneal@696
|
4
|
bgneal@696
|
5 from user_photos.models import Photo
|
bgneal@704
|
6 from user_photos.views import GalleryView
|
bgneal@696
|
7
|
bgneal@695
|
8
|
bgneal@704
|
9 urlpatterns = patterns('',
|
bgneal@704
|
10 url(r'^upload/$', 'user_photos.views.upload', name='user_photos-upload'),
|
bgneal@696
|
11 url(r'^photo/(?P<pk>\d+)/$',
|
bgneal@696
|
12 DetailView.as_view(model=Photo),
|
bgneal@704
|
13 name='user_photos-detail'),
|
bgneal@704
|
14 url(r'^gallery/(?P<username>[\w.@+-]{1,30})/$',
|
bgneal@704
|
15 GalleryView.as_view(),
|
bgneal@704
|
16 name='user_photos-gallery'),
|
bgneal@695
|
17 )
|