|
1234567891011121314151617181920212223242526272829303132 |
- from django.conf import settings
- from django.conf.urls import url
- from django.conf.urls import include
- from django.urls import path
-
- from . import views
-
- from taggit_templatetags2 import urls as taggit_templatetags2_urls
- import debug_toolbar
-
- urlpatterns = [
- url(r'^$', views.tag_list, name='tag_list'),
- url(r'^tag/(?P<slug>[-\w]+)/$', views.post_list, name='post_list_by_tag'),
- url(r'^posts/$', views.post_list, name='post_list'),
- url(r'^search/', views.search_add, name='search_add'),
- url(r'^search/result/$', views.search_add, name='post_list_by_search'),
- url(r'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'),
- url(r'^post/new/$', views.post_new, name='post_new'),
- url(r'^post/(?P<pk>\d+)/edit/$', views.post_edit, name='post_edit'),
- url(r'^drafts/$', views.post_draft_list, name='post_draft_list'),
- url(r'^post/(?P<pk>\d+)/publish/$', views.post_publish, name='post_publish'),
- url(r'^post/(?P<pk>\d+)/remove/$', views.post_remove, name='post_remove'),
- url(r'^tags/', include('taggit_templatetags2.urls')),
- ]
-
- #external code
- #import from https://django-debug-toolbar.readthedocs.io/en/latest/installation.html
- if settings.DEBUG:
- import debug_toolbar
- urlpatterns += [
- url(r'^__debug__/', include(debug_toolbar.urls)),
- ]
|