1. 程式人生 > >Django2.0以上版本的URL的正則匹配問題

Django2.0以上版本的URL的正則匹配問題

正則表示式形式的URL匹配問題:

1.匯入re_path

from django.urls import path,re_path

2.進行正則匹配

re_path('detail-(\d+).html/',views.detail),

 

參考文獻:https://kinegratii.github.io/2017/09/25/django2-url-path/