from django.conf.urls import url from django.views.generic.base import RedirectView from . import views app_name = "photos" urlpatterns = [ url( r'data/(?P[-\w]+)/$', views.photo_json ), url( r'galleries/private/(?P[-\w]+)$', views.PrivateGallery.as_view(), name="private" ), url( r'galleries/private/(?P\d+)/$', views.PrivateGalleryList.as_view(), name="private_list" ), url( r'galleries/private/$', RedirectView.as_view(url="/photos/galleries/private/1/", permanent=False) ), url( r'galleries/(?P[-\w]+)$', views.Gallery.as_view(), name="private" ), url( r'galleries/(?P\d+)/$', views.GalleryList.as_view(), name="private_list" ), url( r'galleries/$', RedirectView.as_view(url="/photos/galleries/1/", permanent=False) ), url( r'(?P\d+)/$', views.gallery_list, ), url( r'(?P[-\w]+)/$', RedirectView.as_view(url="/photos/%(slug)s/1/", permanent=False) ), url( r'', RedirectView.as_view(url="/photos/1/", permanent=False) ), ]