在URL.py文件中寫入代碼:
from?django.urls?import?path
from?.?import?views
urlpatterns?=?[
???path(r'^index/$',?views.index),
???path(r'^article/(?P<article_id>[0-9]+)/$',?views.article_page),
]
網(wǎng)頁請求出錯404:Using?the?URLconf?defined?in?myblog.urls,?Django?tried?these?URL?patterns,?in?this?order:
admin/
blog/?^index/$
blog/?^article/(?P<article_id>[0-9]+)/$
The?current?path,?blog/index/,?didn't?match?any?of?these.應(yīng)該是正則表達(dá)式?jīng)]有起作用,顯示匹配不到url,請問怎么解決?
添加回答
舉報
0/150
提交
取消