Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/360.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在django项目中找不到页面_Python_Django - Fatal编程技术网

Python 在django项目中找不到页面

Python 在django项目中找不到页面,python,django,Python,Django,在我的django项目中,当我访问localhost:8000时,它会说: Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/ URL.py是: ^$/ hello/$ now/$ ^add/$ todolist/$ userlist/$ admin/ ^currenturl/$ task/addUI/$ task/addUI/taskadd/$ django版本是1.3.3 有什么问

在我的django项目中,当我访问localhost:8000时,它会说:

Page not found (404)
Request Method: GET
Request URL:    http://127.0.0.1:8000/
URL.py是:

^$/
hello/$
now/$
^add/$
todolist/$
userlist/$
admin/
^currenturl/$
task/addUI/$
task/addUI/taskadd/$
django版本是1.3.3
有什么问题,请提前感谢

在您的第一条路径中有一个输入错误,它应该是
^/$
在您的第一条路径中有一个输入错误,它应该是
^/$

如果“APPEND\u slash”为真的话,实际上在regex中不需要最后一个斜杠

    url(r'^$', ...)

请。请参考以下内容:“如果您是那种喜欢所有URL都以斜杠结尾的人(这是Django开发人员的首选),您只需在每个URL模式中添加一个尾随斜杠,并将“附加斜杠”设置为True。如果您希望您的URL不具有尾随斜杠,或者如果您希望根据每个URL确定尾随斜杠,请将“附加斜杠”设置为False,并在您认为合适的URL模式中添加尾随斜杠。”

实际上,如果'APPEND\u slash'为真,则在正则表达式中不需要最后一个斜杠

    url(r'^$', ...)
请。请参考以下内容:“如果您是那种喜欢所有URL都以斜杠结尾的人(这是Django开发人员的首选),您只需在每个URL模式中添加一个尾随斜杠,并将“附加斜杠”设置为True。如果您希望您的URL不具有尾随斜杠,或者如果您希望根据每个URL确定尾随斜杠,请将“附加斜杠”设置为False,并在您认为合适的URL模式中添加尾随斜杠。”