Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

urls.py 1.3KB

1234567891011121314151617181920212223242526272829303132
  1. from django.conf import settings
  2. from django.conf.urls import url
  3. from django.conf.urls import include
  4. from django.urls import path
  5. from . import views
  6. from taggit_templatetags2 import urls as taggit_templatetags2_urls
  7. import debug_toolbar
  8. urlpatterns = [
  9. url(r'^$', views.tag_list, name='tag_list'),
  10. url(r'^tag/(?P<slug>[-\w]+)/$', views.post_list, name='post_list_by_tag'),
  11. url(r'^posts/$', views.post_list, name='post_list'),
  12. url(r'^search/', views.search_add, name='search_add'),
  13. url(r'^search/result/$', views.search_add, name='post_list_by_search'),
  14. url(r'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'),
  15. url(r'^post/new/$', views.post_new, name='post_new'),
  16. url(r'^post/(?P<pk>\d+)/edit/$', views.post_edit, name='post_edit'),
  17. url(r'^drafts/$', views.post_draft_list, name='post_draft_list'),
  18. url(r'^post/(?P<pk>\d+)/publish/$', views.post_publish, name='post_publish'),
  19. url(r'^post/(?P<pk>\d+)/remove/$', views.post_remove, name='post_remove'),
  20. url(r'^tags/', include('taggit_templatetags2.urls')),
  21. ]
  22. #external code
  23. #import from https://django-debug-toolbar.readthedocs.io/en/latest/installation.html
  24. if settings.DEBUG:
  25. import debug_toolbar
  26. urlpatterns += [
  27. url(r'^__debug__/', include(debug_toolbar.urls)),
  28. ]