urls.py 716 B

1234567891011121314151617181920
  1. from django.urls import path, re_path
  2. from django.views.generic import RedirectView, TemplateView
  3. from wiki import views
  4. urlpatterns = [
  5. path('', views.wiki_index, {'cat': "index",}, name='wiki_index'),
  6. re_path(r'cat/(?P<cat>[a-zA-Z0-9_.,-]+)$', views.wiki_index, name='wiki_cat'),
  7. re_path(r'category/(?P<cat>[a-zA-Z0-9_.,-]+)/$', RedirectView.as_view(url='/blog/cat/%(bcat)s')),
  8. re_path(r'tag/(?P<cat>[a-zA-Z0-9_.,-]+)$', views.wiki_index, name='wiki_tag'),
  9. re_path(r'tag/(?P<cat>[a-zA-Z0-9_.,-]+)/$', views.wiki_index, name='wiki_tag_ext'),
  10. re_path(r'(?P<art>[a-zA-Z0-9_.,-]+)$', views.wiki_play, name='wiki_play'),
  11. re_path(r'(?P<art>[a-zA-Z0-9_.,-]+)/$', views.wiki_play, name='wiki_play_ext'),
  12. ]