我試圖用gunicorn和nginx部署我的django項目,我遵循本指南:http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/。我創建了bash腳本gunicorn_start
:http://pastebin.com/J86MQZYa 但是當我運行該腳本,我進入錯誤:Gunicorn在啓動時出現錯誤
[email protected]:~/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: ''
希望有人能幫助我:)
謝謝你,我沒有看到這條線,當我再次執行我有這樣的錯誤:http://pastebin.com/fLmuE3ki。我必須自己創建.wsgi模塊嗎? – Betelgeuse
看看本教程,是的,你必須在本教程結束時檢查目錄結構。我想你把應用程序名稱從「hello」改名爲「icecream」,所以你需要相應地重命名這些東西。 – jbub
是的,目錄的名稱是正確的。唯一不同的是,dir'run'是一個根目錄,並且這些設置位於項目的子目錄中(我有icecream.settings.base.py,..local.py和production.py)。 – Betelgeuse