summaryrefslogtreecommitdiff
path: root/app/jrnl/urls.py
blob: 82a4b22f196297da906fb2df02cb291c807e8966 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from django.urls import path, re_path
from django.views.generic.base import RedirectView

from . import views

app_name = "jrnl"

urlpatterns = [
    path(
        r'feed.xml',
        views.JrnlRSSFeedView(),
        name="feed"
    ),
    re_path(
        r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$',
        views.EntryDetailViewTXT.as_view(),
        name="detail-txt"
    ),
    re_path(
        r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$',
        views.EntryDetailView.as_view(),
        name="detail"
    ),
    re_path(
        r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$',
        views.EntryMonthArchiveView.as_view(month_format='%m'),
        name="list_month"
    ),
    re_path(
        r'(?P<year>\d{4})/$',
        views.EntryYearArchiveView.as_view(),
        name="list_year"
    ),
    re_path(
        r'^(?P<page>\d+)/$',
        views.EntryList.as_view(),
        name="list"
    ),
    re_path(
        r'(?P<slug>[-\w]+)/(?P<page>\d+)/$',
        views.EntryCountryList.as_view(),
        name="list_country"
    ),
    re_path(
        r'^(?P<slug>[-\w]+)/$',
        views.EntryCountryList.as_view(),
        {'page':1}, 
        name="list_country"
    ),
    re_path(
        r'',
        views.EntryList.as_view(),
        {'page':1}, 
        name="list"
    ),
]