django - 以无人身份启动 Gunicorn 时出错

标签 django virtualenv gunicorn

所以当我运行命令时

gunicorn test.wsgi:application --bind 127.0.0.1:8000 --workers=3 --user=nobody

我收到错误:

OSError: [Errno 1] Operation not permitted: '/tmp/wgunicorn-QGaR6q'

这似乎不允许我以其他用户身份启动该进程,因此当我使用 sudo 尝试相同的命令时,我收到一堆错误处理:

ImportError: No module named django.core.wsgi

raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

我是在虚拟环境中完成所有这些操作,所以我认为这与我在 sudo 中时无法识别它有关,但是如果没有 sudo,我没有权限以另一个服务器启动服务器用户。

最佳答案

如果您编辑主管的应用程序配置或在没有 --user 标志的情况下运行命令,我也会遇到同样的问题。我也在使用 digital ocean 水滴,但无法让主管使用用户标志。

关于django - 以无人身份启动 Gunicorn 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21742871/

相关文章:

android - 在这种情况下,我为 android 登录到 RESTful api 调整了什么?

django - 过滤多对多多选字段

python "bad interpreter"错误

DJango + nginx + gunicorn : how to stop caching

django - 在 nginx 上更改标题 'Django administration' 文本

python - 从 UWSGI 下的 Django 登录

django - 我可以告诉一下django TestClient是否正在调用 View 吗

python - 如何让virtualenv Django服务器工作?//根据命令提示符 'missing attribute'

python - 运行 python 脚本会产生 : ImportError: no module named termcolor

linux - Gunicorn 调试 sock 文件的权限被拒绝