【发布时间】:2018-01-17 11:07:01
【问题描述】:
我正在尝试在 Digital Ocean 服务器上使用 Cookiecutter。 (不使用 Docker)
我按照指示在 Ubuntu 16 上安装了 Django、Postgres 和 Gunicorn。 https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
我无法通过允许的主机错误。
DisallowedHost at /
Invalid HTTP_HOST header: '128.199.100.100:8000'.
You may need to add '128.199.100.100' to ALLOWED_HOSTS
我在 production.py 中有设置
ALLOWED_HOSTS = env.list ( 'DJANGO_ALLOWED_HOSTS',
default = [ '128.199.100.100' ] )
是否需要更改任何设置才能使其成为生产环境?
Cookiecutter 站点上的唯一文档是关于 pythonAnywere 和 Docker 的。 http://cookiecutter-django.readthedocs.io/en/latest/deployment-on-pythonanywhere.html
我只想要一个简单的 DO 安装。找不到任何文档?
谢谢。
【问题讨论】:
标签: django production-environment cookiecutter-django