summaryrefslogtreecommitdiff
path: root/app/links/urls.py
blob: 5fdaf30a0bc284eca19df4aa3a8b0b30b70ea3ea (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
from django.conf.urls import url
from django.views.generic.base import RedirectView

from . import views

urlpatterns = [
    url(
        regex=r'tag/(?P<slug>[-\w]+)/(?P<page>\d+)/$',
        view=views.LinkTagListView.as_view(),
        name='list-tag'
    ),
    url(
        regex=r'(?P<slug>[-\d]+).txt$',
        view=views.LinkDetailViewTXT.as_view(),
        name="detail-txt"
    ),
    url(
        regex=r'(?P<slug>[-\d]+)$',
        view=views.LinkDetailView.as_view(),
        name='detail'
    ),
    url(
        regex=r'(?P<page>\d+)/$',
        view=views.LinkListView.as_view(),
        name='list'
    ),
    url(
        regex=r'^tag/(?P<slug>[-\w]+)/$',
        view=RedirectView.as_view(url="/links/tag/%(slug)s/1/", permanent=False),
        name="live-redirect-tag"
    ),
    url(
        regex=r'^$',
        view=RedirectView.as_view(url="/links/1/", permanent=False),
        name="live-redirect"
    ),
]