我使用的是MacOS HighSierra、django 1.11和Python2.7.14。每当我设置视图并运行服务器时,polls/1都会返回404错误。我正在学习官方的django课程。页面上写着-
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/polls/1
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^polls/ ^$ [name='index']
^polls/ ^(?P<question_id>[0-9]+)/$, [name='detail']
^polls/ ^(?P<question_id>[0-9]+)/results/$, [name='results']
^polls/ ^(?P<question_id>[0-9]+)/vote/$, [name='vote']
^admin/
The current path, polls/1, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file.
Change that to False, and Django will display a standard 404 page.
目前没有回答
相关问题 更多 >
编程相关推荐