您的位置:首页 > 编程语言 > Go语言

官网学习django

2017-05-02 22:24 190 查看
https://docs.djangoproject.com/en/1.11/intro/tutorial01/

根据上网站学习,第一个困难是无法显示polls success 的界面  

显示为:

Page not found (404)

Request Method:GET
Request URL:http://localhost:8000/polls
Using the URLconf defined in 
mysite.urls
, Django tried these URL patterns, in this order:
^admin/

The current path, 
polls
, 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.

发现原因为mysite分为父目录和子目录,父目录里的urls.py写了,而执行的是子目录里的urls。

修改后成功出现界面:

Hello, world. You're at the polls index.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: