Cleanup routing and remove middleware

This commit is contained in:
Alexandre Iooss 2021-10-23 15:33:14 +02:00
parent 4514d7e020
commit de6088ca5f
7 changed files with 25 additions and 45 deletions

View file

@ -1,15 +1,19 @@
from django.urls import path, re_path
from .views import (CustomGalleryArchiveIndexView, CustomGalleryDetailView,
CustomGalleryYearArchiveView, GalleryDownload,
GalleryUpload, TagDetail)
CustomGalleryYearArchiveView, CustomPhotoDetailView,
GalleryDownload, GalleryUpload, TagDetail)
# Rather than using photologue default router, we redefine our own router
# with login and permission checks.
app_name = 'photologue'
urlpatterns = [
path('tag/<slug:slug>/', TagDetail.as_view(), name='tag-detail'),
path('gallery/', CustomGalleryArchiveIndexView.as_view(), name='pl-gallery-archive'),
re_path(r'^gallery/(?P<year>\d{4})/$', CustomGalleryYearArchiveView.as_view(), name='pl-gallery-archive-year'),
path('gallery/<slug:slug>/', CustomGalleryDetailView.as_view(), name='pl-gallery'),
path('gallery/<slug:slug>/<int:owner>/', CustomGalleryDetailView.as_view(), name='pl-gallery-owner'),
path('gallery/<slug:slug>/download/', GalleryDownload.as_view(), name='gallery-download'),
path('upload/', GalleryUpload.as_view(), name='gallery-upload'),
path('gallery/<slug:slug>/download/', GalleryDownload.as_view(), name='pl-gallery-download'),
path('photo/<slug:slug>/', CustomPhotoDetailView.as_view(), name='pl-photo'),
path('upload/', GalleryUpload.as_view(), name='pl-gallery-upload'),
]