简体   繁体   English

Django Localhost 上的错误请求 (400)

[英]Bad request (400) on Django Localhost

I have the project successfully deployed through AWS.我已经通过 AWS 成功部署了该项目。 However, I would like to make some changes and experiment on them using localhost:8000/ first before making the changes to AWS server.但是,在对 AWS 服务器进行更改之前,我想先使用localhost:8000/对它们进行一些更改和试验。 I set my settings.py to: ALLOWED_HOSTS = ['IP address', 'www.website.com'] to deploy it.我将我的 settings.py 设置为: ALLOWED_HOSTS = ['IP address', 'www.website.com']来部署它。 Though, I also want to be able to run the server in my local computer so I can experiment it before showing to public.不过,我也希望能够在我的本地计算机上运行服务器,这样我就可以在向公众展示之前对其进行试验。 The url is (r^homepage$') When I go to localhost:8000/homepage , it gives a Bad Request (400). url 是(r^homepage$')当我去localhost:8000/homepage ,它给出了一个错误的请求 (400)。 I tried many permutations of the urls but nothing works.我尝试了许多 url 排列,但没有任何效果。

您可以设置 Debug=True 以查看错误消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM