Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions simpleblog/urls.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
from django.urls import re_path
try:
from django.urls import re_path as u
except ModuleNotFoundError as e:
from django.conf.urls import url as u


from .views import BlogDetailView, BlogListView, LatestEntriesFeed


urlpatterns = [
re_path(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-_\w]+)/$',
BlogDetailView.as_view(),
name='blog_detail',
),
re_path(r'^archive/$',
BlogListView.as_view(
template_name="simpleblog/post_archive.html",
page_template="simpleblog/post_archive_page.html"),
name="blog_archive"),
re_path(r'^latest/feed/$', LatestEntriesFeed()),
re_path(r'^$', BlogListView.as_view(), name='blog_index'),
]
u(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-_\w]+)/$',
BlogDetailView.as_view(),
name='blog_detail'
),
u(r'^archive/$',
BlogListView.as_view(
template_name="simpleblog/post_archive.html",
page_template="simpleblog/post_archive_page.html"),
name="blog_archive"
),
u(r'^latest/feed/$', LatestEntriesFeed()),
u(r'^$', BlogListView.as_view(), name='blog_index')
]