当s

2024-10-01 02:27:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用gunicorn和nginx部署我的django项目,我遵循以下指南:http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/。我创建了bash脚本gunicorn_starthttp://pastebin.com/J86MQZYa 但是当我运行这个脚本时,我会出错:

alex@alex-VirtualBox:~/webapps/hello_ice1/bin$ sudo ./gunicorn_start
Starting icecream as root
Traceback (most recent call last):
File "/home/alex/webapps/hello_ice1/icecream/../bin/gunicorn", line 9, in <module>
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 28, in __init__
self.do_load_config()
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 32, in do_load_config
self.load_config()
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in load_config
self.cfg.set(k.lower(), v)
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 66, in set
self.settings[name].set(value)
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 248, in set
self.value = self.validator(val)
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 30, in _wrapped
return func(*args, **kwargs)
File "/home/alex/webapps/hello_ice1/local/lib/python2.7/site-packages/gunicorn/config.py", line 374, in validate_group
raise ConfigError("No such group: '%s'" % val)
gunicorn.errors.ConfigError: No such group: ''

希望有人能帮助我:)


Tags: inpyconfighellohomelibpackageslocal
1条回答
网友
1楼 · 发布于 2024-10-01 02:27:25

在第29行使用组时,您在第7行注释掉了该组。因此,您要将空白组传递给gunicorn,用户也一样,如果您不想更改默认用户或组,则不要将其传递给gunicorn。在

来自文档:

A valid group id (as an integer) or the name of a user that can be retrieved with a call to pwd.getgrnam(value) or None to not change the worker processes group.

http://docs.gunicorn.org/en/latest/configure.html#group

相关问题 更多 >