我已经安装了gunicorn和我的django项目kb
,当我cd到kb
并运行gunicorn --bind 0.0.0.0:8000 kb.wsgi:application
时,它运行得很好。在
我在/etc/init/gunicorn.conf
上运行nano
description "Gunicorn application server handling myproject"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid user
setgid www-data
chdir /home/ubuntu/kb
exec gunicorn --workers 3 --bind unix:/home/ubuntu/kb/kb.sock kb.wsgi:application
当我运行sudo service gunicorn start
我得到Failed to start gunicorn.service: Unit gunicorn.service not found.
更新
执行行:
^{pr2}$来自一个在virtualenv中安装gunicorn的例子。我已经把exec virtualenv\bin\gunicorn
编辑成exec gunicorn
而不是使用古尼康.conf最好使用下面的文件。。。。在
sudo nano/etc/systemd/system公司/gunicorn服务
在这个文件中添加下面的conf设置。。。。在
更改目录权限。。在
chmod g+x/主页/dj/
chmod g+r/主页/dj/
sudo chgrp www data/home/dj/
注意:请确保gunicorn应该在virtualenv中。。在
仅供参考:pip在virtualenv下安装gunicorn
希望这对你有帮助。。 它对我有用。。在
相关问题 更多 >
编程相关推荐