简体   繁体   English

使用 digitalocean 的 docker 容器上的“DisallowedHost”问题

[英]"DisallowedHost" problem on docker container with digitalocean

I have a dockerized website built with django and react.我有一个用 django 构建的 dockerized 网站并做出反应。 I have created a docker container with nginx and gunicorn for django.我为 Django 创建了一个带有 nginx 和 gunicorn 的 docker 容器。 Everything works fine on local, but when i deploy on the server i get this error在本地一切正常,但是当我在服务器上部署时出现此错误
在此处输入图片说明

Why is this happening ?为什么会这样? also, it seems to be taking the settings from... i don't know, a default settings.py?另外,它似乎是从......我不知道,一个默认的settings.py? ie My ALLOWED_HOSTS configuration, is not the same as this即我的ALLOWED_HOSTS配置,和这个不一样

回溯上的 settings.py

It seems that your DJANGO_SETTINGS_MODULE is not correctly defined for your application.您的 DJANGO_SETTINGS_MODULE 似乎没有为您的应用程序正确定义。 Have you changed your settings path?您是否更改了设置路径?

If that's not the case, check your DigitalOcean's DNS.如果不是这种情况,请检查您的 DigitalOcean 的 DNS。 The A records should match your droplet assigned IP. A 记录应与您的 Droplet 分配的 IP 匹配。

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

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