官网学习django

来源:互联网 发布:手机版淘宝的新品上架 编辑:程序博客网 时间:2024/06/06 03:53

https://docs.djangoproject.com/en/1.11/intro/tutorial01/

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

显示为:

Page not found (404)

Request Method:GETRequest URL:http://localhost:8000/polls

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

  1. ^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.

0 0
原创粉丝点击