[英]How to make Django site accessible via IP address ? (deployed with Helicon Zoo and IIS)
I deploy Django with Helicon Zoo and IIS 我用Helicon Zoo和IIS部署Django
I have my Django project runs on localhost:xxxx My IIS goes live, the default site can be accessed by address However my Django project can't be accessed by IP:xxxx. 我的Django项目在localhost:xxxx上运行我的IIS上线了,可以通过地址访问默认站点,但是IP:xxxx无法访问我的Django项目。 It returns : Bad Request - Invalid Hostname HTTP Error 400. The request hostname is invalid.
它返回:错误的请求-无效的主机名HTTP错误400。请求的主机名无效。
How to make my Django site accessible by IP address? 如何通过IP地址访问我的Django网站? Or how to point the IP address directly to my Django project?
或者如何将IP地址直接指向我的Django项目?
For the site to work on all addresses you need to: 为了使网站能够在所有地址上正常工作,您需要:
It is also necessary to make sure that settings.py
for your project has ALLOWED_HOSTS
record and it contains the domain name that is used to access your site. 还必须确保您的项目的
settings.py
具有ALLOWED_HOSTS
记录,并且其中包含用于访问您的站点的域名。 Here's the link to the Django docs: https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts 这是Django文档的链接: https : //docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.