from django.conf.urls import * from django.views.generic.base import RedirectView urlpatterns = patterns('', (r'data/(?P[-\w]+)/$', 'photos.views.photo_json'), (r'galleries/(?P[-\w]+)/$', 'photos.views.gallery'), (r'(?P\d+)/$', 'photos.views.gallery_list'), (r'(?P[-\w]+)/$', RedirectView.as_view(url="/photos/%(slug)s/1/", permanent=False)), (r'', RedirectView.as_view(url="/photos/1/", permanent=False)), )