Esempio n. 1
0
from django.urls import path

from blog.views import PostLV, PostDV, PostAV, PostYAV, PostMAV, PostDAV, PostTAV

app_name = 'blog'
urlpatterns = [
    path('', PostLV.as_view(), name='index'),
    path('post/', PostLV.as_view(), name='post_list'),
    path('post/<str:slug>/', PostDV.as_view(), name='post_detail'),
    path('archive/', PostAV.as_view(), name='post_archive'),
    path('<int:year>/', PostYAV.as_view(), name='post_year_archive'),
    path('<int:year>/<str:month>/',
         PostMAV.as_view(),
         name='post_month_archive'),
    path('<int:year>/<str:month>/<int:day>/',
         PostDAV.as_view(),
         name='post_day_archive'),
    path('today/', PostTAV.as_view(), name='post_today_archive'),
]
Esempio n. 2
0
from django.conf.urls import url
from blog.views import PostLV, PostDV, PostAV, PostYAV, PostMAV, PostDAV, PostTAV, TagTV, PostTOL, SearchFormView

app_name = 'blog'

urlpatterns = [
    url(r'^today/$', PostTAV.as_view(), name='post_today_archive'),
    url(r'^tag/$', TagTV.as_view(), name='tag_cloud'),
    url(r'^tag/(?P<tag>[^/]+(?u))/$', PostTOL.as_view(), name='tagged_object_list'),
    url(r'^$', PostLV.as_view(), name='index'), # "blog:index"
    url(r'^post/$', PostLV.as_view(), name='post_list'),
    url(r'^post/(?P<slug>[-\w]+)/$', PostDV.as_view(), name='post_detail'),
    url(r'^archive/$', PostAV.as_view(), name='post_archive'),
    url(r'^(?P<year>\d{4})/$', PostYAV.as_view(), name='post_year_archive'),
    url(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$', PostMAV.as_view(), name='post_month_archive'),
    url(r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/$', PostDAV.as_view(), name='post_day_archive'),
    url(r'^search/$', SearchFormView.as_view(), name='search'),
]