Change photo slug to filename
This commit is contained in:
parent
bac62c6d6d
commit
26a12450f4
4 changed files with 43 additions and 48 deletions
|
@ -1,6 +1,9 @@
|
|||
from django.urls import path
|
||||
from django.urls import path, register_converter
|
||||
|
||||
from . import converters, views
|
||||
|
||||
register_converter(converters.FilenamePathConverter, 'filename')
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'gallery'
|
||||
|
||||
|
@ -9,7 +12,7 @@ urlpatterns = [
|
|||
path('', views.AlbumsList.as_view(), name='main_url'),
|
||||
path('about/', views.About.as_view(), name='about_url'),
|
||||
path('photostream/', views.PhotosList.as_view(), name='photos_url'),
|
||||
path('albums/<path:album_slug>/<int:photo_slug>/', views.PhotoDetail.as_view(), name='photo_url'),
|
||||
path('albums/<path:album_slug>/<filename:photo_slug>', views.PhotoDetail.as_view(), name='photo_url'),
|
||||
path('albums/<path:album_slug>/', views.AlbumDetail.as_view(), name='album_url'),
|
||||
path('albums/', views.AlbumsList.as_view(), name='albums_url'),
|
||||
path('<path:redir_path>/', views.redirect_to_album, name='redirect_to_album'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue