python – 我得到一个错误400:错误的请求在自定义的Heroku域,但
发布时间:2020-12-16 23:05:17 所属栏目:Python 来源:网络整理
导读:我刚把Django项目推送到Heroku.它工作正常在 http://rtd-staging.herokuapp.com/rtd2015/,但由于某些原因,我得到一个400错误:当我访问使用: http://staging.researchthroughdesign.org/rtd2015/错误请求 我知道CNAME设置正确,因为在推送到heroku的过程中,
我刚把Django项目推送到Heroku.它工作正常在
http://rtd-staging.herokuapp.com/rtd2015/,但由于某些原因,我得到一个400错误:当我访问使用:
http://staging.researchthroughdesign.org/rtd2015/错误请求
我知道CNAME设置正确,因为在推送到heroku的过程中,它表示Heroku应用程序已经崩溃,所以它肯定是指向正确的应用程序. 这是错误的日志: 2014-04-23T18:32:29.981976+00:00 heroku[router]: at=info method=GET path=/ host=staging.researchthroughdesign.org request_id=b8fe3ac9-e062-493b-b3bf-862c60e4001b fwd="82.34.146.252" dyno=web.1 connect=1ms service=7ms status=400 bytes=226 解决方法
您必须将您的网站域设置为允许的主机.将其放在您的settings.py中:
ALLOWED_HOSTS = [".herokuapp.com",".researchthroughdesign.org"] (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 利用Python来写吃鸡的“理论外挂”!学会之后基本把把吃鸡!
- 【Python有坑系列】报错NameError: name 'reload'
- 用Python求和非整数([[1],[2]])= [1,2]
- Python运算符【==】和【is】的差别
- python – 获取伦敦境内坐标的所有维基百科文章
- python – Google Dataflow上Apache Beam示例的权限错误
- 基于python中staticmethod和classmethod的区别(详解)
- python – 如何将大图像作为numpy.memmap对象读取
- 在使用Mercurial(使用TortoiseHG)之前自动搁置?
- Windows平台Python编程必会模块之pywin32介绍