WARNINGS:
?: (2_0.W001) Your URL pattern '^(\d+)' has a route that contains '(?P<', begins with a '^', or ends with a '$'. This was likely an oversight when migrating to django.urls.path().
原因:从Django2.0以后,urls.py配置不同,path不能像2.0之前的url使用正则
from django.urls import path,re_path
from . import views
urlpatterns = [
path('',views.index),
re_path('(\d+)/',views.detail),
]
用re_path可使用正则表达式