django-photos / src / photos / urls.py

from photos.views import album_list, photo_list, photo_detail, store_photo
from django.views.generic.list_detail import object_detail
from django.conf.urls.defaults import *
from photos.models import Photo, Album

ALBUM_DETAIL_DICT = {'queryset': Album.objects.filter(display=True)}
PHOTO_DETAIL_DICT = {'queryset': Photo.objects.filter(display=True)}

urlpatterns = patterns('',
    url(r'^albums/$', album_list, name='albums'),
    url(r'^albums/(?P<user_id>\d+)/$', album_list, name='albums-userid'),
    url(r'^albums/(?P<username>.+)/$', album_list, name='albums-username'),
    url(r'^album/(?P<object_id>\d+)/$', object_detail, ALBUM_DETAIL_DICT, name='album-detail'),
    url(r'^photos/$', photo_list, name='photos'),
    url(r'^photos/(?P<user_id>\d+)/$', photo_list, name='photos-userid'),
    url(r'^photo/(?P<object_id>\d+)/$', object_detail, PHOTO_DETAIL_DICT, name='photo-detail'),
    url(r'^photos/(?P<album_id>\d+)/(?P<object_id>\d+)/$', photo_detail, PHOTO_DETAIL_DICT, name='photo-album-detail'),
    url(r'^photos/(?P<username>.+)/', photo_list, name='photos-username'),
    url(r'^photos/store/', store_photo, name='photos-store')
)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.