from django.urls import path, re_path from django.views.generic.base import RedirectView from . import views app_name = "photos" urlpatterns = [ path( r'daily/', views.DailyPhotoList.as_view(), name="daily_photo_list" ), path( r'daily/', views.DailyPhotoList.as_view(), {'page': 1}, name="daily_photo_list" ), path( r'data/(/', views.photo_json ), re_path( r'data/admin/preview/(?P\d+)/$', views.photo_preview_json, name="admin_image_preview" ), re_path( r'data/admin/tn/(?P\d+)/$', views.thumb_preview_json, name="admin_thumb_preview" ), re_path( r'galleries/private/(?P[-\w]+)$', views.PrivateGallery.as_view(), name="private" ), re_path( r'galleries/private/(?P\d+)/$', views.PrivateGalleryList.as_view(), name="private_list" ), re_path( r'galleries/private/$', RedirectView.as_view(url="/photos/galleries/private/1/", permanent=False) ), re_path( r'galleries/(?P[-\w]+)$', views.Gallery.as_view(), name="private" ), re_path( r'galleries/(?P\d+)/$', views.GalleryList.as_view(), name="private_list" ), re_path( r'galleries/$', RedirectView.as_view(url="/photos/galleries/1/", permanent=False) ), re_path( r'(?P\d+)/$', views.gallery_list, ), re_path( r'(?P[-\w]+)/$', RedirectView.as_view(url="/photos/%(slug)s/1/", permanent=False) ), re_path( r'', RedirectView.as_view(url="/photos/1/", permanent=False) ), ]