from django.urls import path

from . import views

urlpatterns = [
    path('', views.index, name='index'),
    path('stream/<stream_slug>/', views.stream_detail, name='stream_detail'),
    # ex: /vacation/
    path('<collection_slug>/', views.collection_detail, name='collection_detail'),
    # /family/home/fun/DCIM_4242.jpg/view
    path('<collection_slug>/<file_path>/<imagename>/view/', views.image_detail, name='image_detail'),
    path('<collection_slug>/<file_path>/<imagename>/full/', views.image_full, name='image_full'),
    path('<collection_slug>/<file_path>/<imagename>/max/', views.image_max, name='image_max'),
    path('<collection_slug>/<imagename>/view/', views.rootdir_image_detail, name='rootdir_image_detail'),
    path('<collection_slug>/<imagename>/full/', views.rootdir_image_full, name='rootdir_image_full'),
    path('<collection_slug>/<imagename>/max/', views.rootdir_image_max, name='rootdir_image_max'),
    path('<collection_slug>/<directory>/', views.directory_detail, name='directory_detail'),
    path('imagedetail/<imagehash>/', views.imagehash_detail, name='imagehash_detail'),
]

@@ -21,17 +21,26 @@
 ort path
+, re_path
 %0A
-
 %0Afrom . 
@@ -334,30 +334,38 @@
 pg/view%0A    
+re_
 path(
-'
+r'%5E(?P
 %3Ccollection_
@@ -361,33 +361,43 @@
 collection_slug%3E
-/
+%5B-%5Cw%5D+)/(?P
 %3Cfile_path%3E/%3Cima
@@ -383,33 +383,39 @@
 )/(?P%3Cfile_path%3E
-/
+.+)/(?P
 %3Cimagename%3E/view
@@ -401,38 +401,42 @@
 )/(?P%3Cimagename%3E
+.+)
 /view/
+$
 ', views.image_d
@@ -460,38 +460,46 @@
 e_detail'),%0A    
+re_
 path(
-'
+r'%5E(?P
 %3Ccollection_slug
@@ -491,33 +491,43 @@
 collection_slug%3E
-/
+%5B-%5Cw%5D+)/(?P
 %3Cfile_path%3E/%3Cima
@@ -513,33 +513,39 @@
 )/(?P%3Cfile_path%3E
-/
+.+)/(?P
 %3Cimagename%3E/full
@@ -531,38 +531,42 @@
 )/(?P%3Cimagename%3E
+.+)
 /full/
+$
 ', views.image_f
@@ -586,38 +586,46 @@
 age_full'),%0A    
+re_
 path(
-'
+r'%5E(?P
 %3Ccollection_slug
@@ -625,17 +625,27 @@
 on_slug%3E
-/
+%5B-%5Cw%5D+)/(?P
 %3Cfile_pa
@@ -647,17 +647,23 @@
 le_path%3E
-/
+.+)/(?P
 %3Cimagena
@@ -657,37 +657,41 @@
 )/(?P%3Cimagename%3E
+.+)
 /max/
+$
 ', views.image_m
@@ -709,38 +709,46 @@
 mage_max'),%0A    
+re_
 path(
-'
+r'%5E(?P
 %3Ccollection_slug
@@ -740,33 +740,43 @@
 collection_slug%3E
-/
+%5B-%5Cw%5D+)/(?P
 %3Cimagename%3E/view
@@ -770,22 +770,26 @@
 agename%3E
+.+)
 /view/
+$
 ', views
@@ -837,38 +837,46 @@
 e_detail'),%0A    
+re_
 path(
-'
+r'%5E(?P
 %3Ccollection_slug
@@ -868,33 +868,43 @@
 collection_slug%3E
-/
+%5B-%5Cw%5D+)/(?P
 %3Cimagename%3E/full
@@ -898,22 +898,26 @@
 agename%3E
+.+)
 /full/
+$
 ', views
@@ -961,38 +961,46 @@
 age_full'),%0A    
+re_
 path(
-'
+r'%5E(?P
 %3Ccollection_slug
@@ -1000,17 +1000,27 @@
 on_slug%3E
-/
+%5B-%5Cw%5D+)/(?P
 %3Cimagena
@@ -1022,21 +1022,25 @@
 agename%3E
+.+)
 /max/
+$
 ', views
@@ -1086,30 +1086,38 @@
 _max'),%0A    
+re_
 path(
-'
+r'%5E(?P
 %3Ccollection_
@@ -1121,17 +1121,27 @@
 on_slug%3E
-/
+%5B-%5Cw%5D+)/(?P
 %3Cdirecto
@@ -1143,17 +1143,21 @@
 rectory%3E
-/
+.+)/$
 ', views
@@ -1205,22 +1205,27 @@
 '),%0A    
+re_
 path(
-'
+r'%5E
 imagedet
@@ -1228,16 +1228,19 @@
 edetail/
+(?P
 %3Cimageha
@@ -1242,17 +1242,22 @@
 agehash%3E
-/
+%5Cw+)/$
 ', views

Bring back the old regex matches to support /