2

第一次尝试使用 Gunicorn 部署 Django,虽然它启动良好,但当我尝试请求页面时得到以下两个回溯。显然,Gunicorn 使用 django-configurations 整理设置有些问题。有任何想法吗?

gunicorn mysite.wsgi:application

2013-10-27 16:26:38 [16436] [INFO] Starting gunicorn 18.0
2013-10-27 16:26:38 [16436] [INFO] Listening at: http://127.0.0.1:8000 (16436)
2013-10-27 16:26:38 [16436] [INFO] Using worker: sync
2013-10-27 16:26:38 [16441] [INFO] Booting worker with pid: 16441
2013-10-27 16:26:39 [16441] [ERROR] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py", line 131, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 236, in __call__
    self.load_middleware()
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 45, in load_middleware
    for middleware_path in settings.MIDDLEWARE_CLASSES:
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/matt/Envs/site/mysite/mysite/settings.py", line 161, in <module>
    class Dev(Common):
  File "/usr/local/lib/python2.7/dist-packages/configurations/base.py", line 30, in __new__
    raise ImproperlyConfigured(install_failure)
ImproperlyConfigured: django-configurations settings importer wasn't correctly installed. Please use one of the starter functions to install it as mentioned in the docs: http://django-configurations.readthedocs.org/
2013-10-27 16:26:39 [16441] [ERROR] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py", line 131, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 236, in __call__
    self.load_middleware()
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 45, in load_middleware
    for middleware_path in settings.MIDDLEWARE_CLASSES:
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 132, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/matt/Envs/site/mysite/mysite/settings.py", line 161, in <module>
    class Dev(Common):
  File "/usr/local/lib/python2.7/dist-packages/configurations/base.py", line 30, in __new__
    raise ImproperlyConfigured(install_failure)
ImproperlyConfigured: django-configurations settings importer wasn't correctly installed. Please use one of the starter functions to install it as mentioned in the docs: http://django-configurations.readthedocs.org/
4

0 回答 0