summaryrefslogtreecommitdiff
path: root/app/resume/urls.py
blob: 0d8b40aa4f81a525db4a6467758b30f220eb08e4 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
from django.conf.urls import url
from django.views.generic.base import RedirectView

from . import views

app_name = "resume"

urlpatterns = [
    url(
        r'pubs/(?P<page>\d+)/$',
        views.PublisherListView.as_view(),
        name='list',
    ),
    url(
        r'pubs/(?P<publisher>[-\w]+)/(?P<page>\d+)/$',
        views.ByPublisherListView.as_view(),
        name='list_by_publisher',
    ),
    url(
        r'pubs/(?P<publisher>[-\w]+)/(?P<slug>[-\w]+)$',
        views.PubItemDetailView.as_view(),
        name='detail',
    ),
    # redirect /slug/ to /slug/1/ for live server
    url(
        r'pubs/(?P<publisher>[-\w]+)/$',
        RedirectView.as_view(url="/resume/pubs/%(publisher)s/1/", permanent=False),
        name="live_publisher_redirect"
    ),
    url(
        r'pubs/$',
        RedirectView.as_view(url="/resume/pubs/1/", permanent=False),
        name="live_redirect"
    ),
    url(
        r'^(?P<path>[-\w]+)(?:/(?P<slug>[-\w]+))$',
        views.PageView.as_view(),
        name="pages"
    ),
]