0

在此处此处此处使用以下教程和 github 模板,我在晚上的大部分时间都在与 django 和 mezzanine 搏斗。现在我有一个mezzanine-project, 调用uccdev它在我运行时运行良好python manage.py runserver

现在,我想使用gunicornforeman使用东西,以便以后可以将我的项目上传到heroku。

根据乔什·芬尼的说法,

添加下面的 Procfile 让 Mezzanine 在 Gunicorn 上运行,并成功让 Heroku 为我的静态文件提供服务。首先 if 运行 collectstatic 以确保所有静态媒体都在您的应用程序中的适当位置,其次它运行 Gunicorn 服务器。

web: python manage.py collectstatic --noinput; python manage.py run_gunicorn -b 0.0.0.0:$PORT

gunicorn在我settings.py的. _foreman start

Pythoness-998:uccdev gersande$ foreman start
01:02:45 web.1  | started with pid 7592
01:02:45 web.1  | /usr/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:48: UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django 1.5 requires. Will fall back to the domains configured as sites.
01:02:45 web.1  |   warn("You haven't defined the ALLOWED_HOSTS settings, which "
01:02:46 web.1  | 0 static files copied, 549 unmodified.
01:02:46 web.1  | /usr/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:48: UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django 1.5 requires. Will fall back to the domains configured as sites.
01:02:46 web.1  |   warn("You haven't defined the ALLOWED_HOSTS settings, which "
01:02:46 web.1  | 2013-12-23 01:02:46 [7594] [INFO] Starting gunicorn 18.0
01:02:46 web.1  | 2013-12-23 01:02:46 [7594] [INFO] Listening at: http://0.0.0.0:5000 (7594)
01:02:46 web.1  | 2013-12-23 01:02:46 [7594] [INFO] Using worker: sync
01:02:46 web.1  | 2013-12-23 01:02:46 [7597] [INFO] Booting worker with pid: 7597
01:02:46 web.1  | 2013-12-23 01:02:46 [7597] [ERROR] Exception in worker process:
01:02:46 web.1  | Traceback (most recent call last):
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
01:02:46 web.1  |     worker.init_process()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
01:02:46 web.1  |     self.wsgi = self.app.wsgi()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
01:02:46 web.1  |     self.callable = self.load()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 142, in load
01:02:46 web.1  |     return mod.make_command_wsgi_application(self.admin_media_path)
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 113, in make_command_wsgi_application
01:02:46 web.1  |     reload_django_settings()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 109, in reload_django_settings
01:02:46 web.1  |     logging_config_func(settings.LOGGING)
01:02:46 web.1  |   File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/config.py", line 803, in dictConfig
01:02:46 web.1  |     dictConfigClass(config).configure()
01:02:46 web.1  |   File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/config.py", line 509, in configure
01:02:46 web.1  |     raise ValueError("dictionary doesn't specify a version")
01:02:46 web.1  | ValueError: dictionary doesn't specify a version
01:02:46 web.1  | Traceback (most recent call last):
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
01:02:46 web.1  |     worker.init_process()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
01:02:46 web.1  |     self.wsgi = self.app.wsgi()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
01:02:46 web.1  |     self.callable = self.load()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 142, in load
01:02:46 web.1  |     return mod.make_command_wsgi_application(self.admin_media_path)
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 113, in make_command_wsgi_application
01:02:46 web.1  |     reload_django_settings()
01:02:46 web.1  |   File "/usr/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 109, in reload_django_settings
01:02:46 web.1  |     logging_config_func(settings.LOGGING)
01:02:46 web.1  |   File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/config.py", line 803, in dictConfig
01:02:46 web.1  |     dictConfigClass(config).configure()
01:02:46 web.1  |   File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/config.py", line 509, in configure
01:02:46 web.1  |     raise ValueError("dictionary doesn't specify a version")
01:02:46 web.1  | ValueError: dictionary doesn't specify a version
01:02:46 web.1  | 2013-12-23 01:02:46 [7597] [INFO] Worker exiting (pid: 7597)
01:02:46 web.1  | 2013-12-23 01:02:46 [7594] [INFO] Shutting down: Master
01:02:46 web.1  | 2013-12-23 01:02:46 [7594] [INFO] Reason: Worker failed to boot.
01:02:46 web.1  | exited with code 3
01:02:46 system | sending SIGTERM to all processes
SIGTERM received

任何想法如何指定字典的版本?

4

1 回答 1

0

来自用户渣滓的回答 -为 gunicorn 创建 supervisord 脚本的正确方法?姜戈 1.6

我将以下内容添加到我的 settings.py 中:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
}
于 2014-01-20T01:34:54.920 回答