【发布时间】:2016-11-03 13:43:06
【问题描述】:
我正在尝试根据本教程使用 gunicorn 和 nginx 部署 django 应用:
但我无法让我的 gunicorn 正常工作,
这是我的 /etc/init/gunicorn.conf:
description "Gunicorn application server handling myproject"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid me
setgid www-data
exec myprojectenv/bin/gunicorn --workers 3 --bind unix:/myproject/myproject.sock myproject.wsgi:application
当我在我的 virtualenv 中运行时:
gunicorn --bind 0.0.0.0:8000 myproject.wsgi:application
一切正常。 但每次我启动 gunicorn 时,我的 gunicorn 错误日志中都会出现此错误:
ImportError: No module named 'myproject'
我检查了所有可能的选项,但没有任何改变。 我有什么遗漏吗? 提前致谢。
编辑:
我在 exec 之前添加了一个 chdir 行:
chdir /myproject/myprojectenv
我还在继续
ImportError: No module named 'myproject'
【问题讨论】:
-
你的项目名称是什么:
'myaproject'或'myproject'? -
这是我的项目,有错字,我会改正的。
标签: python django ubuntu wsgi gunicorn