1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
from django.conf.urls import url
from django.views.generic.base import RedirectView
from . import views
app_name = "photos"
urlpatterns = [
url(
r'data/(?P<slug>[-\w]+)/$',
views.photo_json
),
url(
r'galleries/(?P<slug>[-\w]+)/$',
views.gallery,
),
url(
r'(?P<page>\d+)/$',
views.gallery_list,
),
url(
r'(?P<slug>[-\w]+)/$',
RedirectView.as_view(url="/photos/%(slug)s/1/", permanent=False)
),
url(
r'',
RedirectView.as_view(url="/photos/1/", permanent=False)
),
]
|