summaryrefslogtreecommitdiff
path: root/app/jrnl/urls.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-02-06 10:36:26 -0600
committerluxagraf <sng@luxagraf.net>2018-02-06 10:36:26 -0600
commit58473dd4e0758894f15f834bddedd0caf11cfa59 (patch)
tree6f4d4fb9e120813bcbaaf03044fdb84eb7764c41 /app/jrnl/urls.py
parentadcd4671a261aa72d459b691aabb6f2eef2a0cb7 (diff)
converted to new path url structure and updated pagination to handle it.
Diffstat (limited to 'app/jrnl/urls.py')
-rw-r--r--app/jrnl/urls.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/app/jrnl/urls.py b/app/jrnl/urls.py
index aa01d69..a7bcc0e 100644
--- a/app/jrnl/urls.py
+++ b/app/jrnl/urls.py
@@ -1,4 +1,4 @@
-from django.conf.urls import url
+from django.urls import path, re_path
from django.views.generic.base import RedirectView
from . import views
@@ -6,51 +6,51 @@ from . import views
app_name = "jrnl"
urlpatterns = [
- url(
+ path(
r'^feed.xml',
views.JrnlRSSFeedView(),
name="feed"
),
- url(
- r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$',
+ re_path(
+ r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$',
views.EntryDetailViewTXT.as_view(),
name="detail-txt"
),
- url(
- r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$',
+ re_path(
+ r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$',
views.EntryDetailView.as_view(),
name="detail"
),
- url(
+ re_path(
r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$',
views.EntryMonthArchiveView.as_view(month_format='%m'),
name="list_month"
),
- url(
+ re_path(
r'(?P<year>\d{4})/$',
views.EntryYearArchiveView.as_view(),
name="list_year"
),
- url(
+ 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"
),
- url(
- r'(?P<page>\d+)/$',
- views.EntryList.as_view(),
- name="list"
- ),
- # redirect /slug/ to /slug/1/ for live server
- url(
- r'(?P<slug>[-\w]+)/$',
- RedirectView.as_view(url="/jrnl/%(slug)s/1/", permanent=False),
- name="live_location_redirect"
+ re_path(
+ r'^(?P<slug>[-\w]+)/$',
+ views.EntryCountryList.as_view(),
+ {'page':1},
+ name="list_country"
),
- # redirect / to /1/ for live server
- url(
+ re_path(
r'',
- RedirectView.as_view(url="/jrnl/1/", permanent=False),
- name="live_redirect"
+ views.EntryList.as_view(),
+ {'page':1},
+ name="list"
),
]