【发布时间】:2018-07-29 07:13:18
【问题描述】:
我使用最新版本的cookiecutter-django 构建了一个 Django 项目,它似乎在我的本地计算机上运行良好,当我使用各种设置文件通过python manage.py runserver 运行它时。我正在尝试在 Digital Ocean(运行 Ubuntu 16.04)上测试我的 Gunicorn 服务器,但由于某种原因,当使用 production.py 时,服务器无法正常运行。
当我在 bash 上执行以下命令时:
gunicorn --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=config.settings.test --preload config.wsgi
一切正常,我得到了这些:
[2018-02-18 23:31:14 -0500] [31662] [INFO] Starting gunicorn 19.7.1
[2018-02-18 23:31:14 -0500] [31662] [INFO] Listening at: http://0.0.0.0:8000 (31662)
[2018-02-18 23:31:14 -0500] [31662] [INFO] Using worker: sync
[2018-02-18 23:31:14 -0500] [31666] [INFO] Booting worker with pid: 31666
但是当我没有指定设置文件并默认为production.py和gunicorn --bind 0.0.0.0:8000 --preload config.wsgi,其中环境变量DJANGO_SETTINGS_MODULE设置为config.settings.production时,我只能得到这些:
DEBUG 2018-02-18 23:31:55,786 base 31681 140442914699008 Configuring Raven for host: <raven.conf.remote.RemoteConfig object at 0x7fbb5cc0b668>
INFO 2018-02-18 23:31:55,786 base 31681 140442914699008 Raven is not configured (logging is disabled). Please see the documentation for more information.
它几乎只是卡在那里。什么可能导致此问题?
【问题讨论】:
标签: python django gunicorn digital-ocean cookiecutter-django