标签:路由 art 静态路由 多个 article strong min 管理 special
路由分为两种静态路由和动态路由
path(‘admin/‘, admin.site.urls),
path(‘test/‘, views.test_view),
path(‘login/‘, views.login_view),
# re_path(r‘^articles/2003/$‘, views.special_case_2003),
# re_path(r‘^articles/(?P<year>[0-9]{4})/$‘, views.article_archive),
#re_path(r‘^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$‘, views.article_archive)
# re_path(r‘^articles/([0-9]{4})/([0-9]{2})/$‘, views.article_archive2)
re_path(r‘^articles/(?P<arg1>[0-9]{4})/(?P<arg2>[0-9]{2})/(?P<ddd>[\w-]+)/$‘, views.article_archive3)
Django的路由匹配心法
自定义路由converter
管理多个URL文件
省略重复的URL
标签:路由 art 静态路由 多个 article strong min 管理 special
原文地址:https://www.cnblogs.com/qiulovelinux/p/12712687.html