【发布时间】:2013-06-02 22:49:01
【问题描述】:
我已经按照this blogpost 设置了主管来运行 celeryd、celerycam 和 gunicorn。一开始一切都很顺利。第一次重启后,什么都没有启动。我能看到的日志是这种形式的。
未知命令:'run_gunicorn'
键入“manage.py help”以了解用法。
我猜这是因为主管没有“看到”我的环境变量,如 DJANGO_SETTINGS_MODULE、DB_HOST 等。我将它们全部放在 /etc/environment 中,但它没有用。同样,我尝试将它们放在 /etc/supervisor/supervisord.conf 中 [supervisor] 下的 environment 标签上。我收到以下错误
启动主管:错误:格式字符串 '\'DEBUG\'="False", \'DJANGO_SETTINGS_MODULE\'="project.settings.production",for “环境”格式错误
我的supervisord.conf在[supervisord]下有如下内容
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
environment = 'DEBUG'="False",'DJANGO_SETTINGS_MODULE'="project.settings.production",
[更新 - 添加来自 celery、gunicorn、celerycam 的日志]
来自 celeryd_err.log 的日志
ImportError: 没有名为 debug_toolbar 的模块
ImportError: 没有名为 debug_toolbar 的模块
ImportError: 没有名为 debug_toolbar 的模块
来自 celerycam_err.log 的日志
ImportError: 没有名为 debug_toolbar 的模块
ImportError: 没有名为 debug_toolbar 的模块
ImportError: 没有名为 debug_toolbar 的模块
来自 gunicorn_err.log 的日志
键入“manage.py help”以了解用法。
未知命令:'run_gunicorn'
键入“manage.py help”以了解用法。
未知命令:'run_gunicorn'
键入“manage.py help”以了解用法。
未知命令:'run_gunicorn'
对我在哪里可以获得解决方案有任何建议吗?提前感谢您的帮助!
【问题讨论】:
-
你的
settings模块的目录结构是什么? -
当您尝试启动服务器时,您确定您仍在您的环境中吗?
-
@J.Ghyllebert 我实际上并没有在此服务器中使用虚拟环境。此服务器将专门用于此项目。
-
@karthikr 我正在为这个项目使用twoscoops-of-django 模板。
-
如果你需要查看我的celeryd.conf和其他conf文件,请在此处留言。
标签: django deployment environment-variables supervisord