Page not found 404 on Django site?

前端 未结 13 2335
既然无缘
既然无缘 2020-12-14 00:46

I\'m following the tutorial on Django\'s site to create a simple poll app. However, Django is unable to resolve \"//127.0.0.1:8000/polls\" , even though I\'ve defined the re

13条回答
  •  执念已碎
    2020-12-14 01:14

    I had the same problem.

    It turns out I was confused because of the multiple directories named "mysite".

    I wrongly created a urls.py file in the root "mysite" directory (which contains "manage.py"), then pasted in the code from the website.

    To correct it I deleted this file, went into the mysite/mysite directory (which contains "settings.py"), modified the existing "urls.py" file, and replaced the code with the tutorial code.

    In a nutshell, make sure your urls.py file is in the right directory.

提交回复
热议问题