創(chuàng)建models報錯404
Page not found?(404)
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/blog/index/ |
Using the URLconf defined in?myblog.urls
, Django tried these URL patterns, in this order:
admin/
blog/ ^$
blog2/
The current path,?blog/index/
, didn't match any of these.
這個應該怎么解決啊,求大家
2020-04-01
進入APP里的urls.py里,也就是文中的blog文件夾里那個。
from?django.conf.urls?import?url,?include
from?.?import?views
urlpatterns?=?[
????url(r'^$',?views.index),
]
把?url(r'^$',?views.index),里的那個$去掉,然后就ok了。我跟你一樣遇到這個問題,可能是因為django與視頻里的版本不同的原因吧?