Linux   发布时间:2022-03-31  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了为gunicorn创建supervisord脚本的正确方法? Django 1.6大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

这是我的gonicorn.conf,但我似乎无法正确使用命令.当我在命令行中键入它时,Im尝试的命令正在工作,但不是作为Supervisor命令. [program:gunicorn] directory = /home/USER/.virtualenvs/SITE/myApp/ command=/home/USER/.virtualenvs/SITE/bin/python /home/USER/
这是我的gonicorn.conf,但我似乎无法正确使用命令.当我在命令行中键入它时,Im尝试的命令正在工作,但不是作为Supervisor命令.

[program:gunicorn]
directory = /home/USER/.virtualenvs/SITE/myApp/
command=/home/USER/.virtualenvs/SITE/bin/python /home/USER/.virtualenvs/SITE/myApp/manage.py run_gunicorn myApp.wsgi:application -c /home/USER/.virtualenvs/SITE/myApp/gunicorn.conf.py
user = USER
autostart = true
autorestart = true
redirect_stderr = true
stdout_logfile = /home/USER/logs/gunicorn.log
stderr_logfile = /home/USER/logs/gunicorn_err.log

gunicorn的正确命令是什么?

这是我尝试启动gunicorn时得到的错误

/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/sorl/thumbnail/Helpers.py:5: DeprecationWarning: django.utils.simplejson is deprecated; use json instead.
  from django.utils import simplejson

2013-02-25 13:46:55 [3975] [INFO] StarTing gunicorn 0.17.2
2013-02-25 13:46:55 [3975] [INFO] Listening at: http://127.0.0.1:8000 (3975)
2013-02-25 13:46:55 [3975] [INFO] Using worker: sync
2013-02-25 13:46:55 [3988] [INFO] BooTing worker with pid: 3988
2013-02-25 13:46:55 [3988] [ERROR] Exception in worker process:
TraceBACk (most recent call last):
  File "/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/gunicorn/arbiter.py",line 485,in spawn_worker
    worker.init_process()
  File "/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/gunicorn/workers/base.py",line 100,in init_process
    self.wsgi = self.app.wsgi()
  File "/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/gunicorn/app/base.py",line 103,in wsgi
    self.callable = self.load()
  File "/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py",line 133,in load
    return mod.make_command_wsgi_application(self.admin_media_path)
  File "/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py",line 113,in make_command_wsgi_application
    reload_django_setTings()
  File "/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py",line 109,in reload_django_setTings
    logging_config_func(setTings.LOGGING)
  File "/usr/lib/python2.7/logging/config.py",line 777,in DictConfig
    DictConfigClass(config).configure()
  File "/usr/lib/python2.7/logging/config.py",line 503,in configure
    raise ValueError("Dictionary doesn't specify a version")
ValueError: Dictionary doesn't specify a version
TraceBACk (most recent call last):
  File "/home/USERNAME/.virtualenvs/SITE/local/lib/python2.7/site-packages/gunicorn/arbiter.py",in configure
    raise ValueError("Dictionary doesn't specify a version")
ValueError: Dictionary doesn't specify a version

解决方法

[program:projectname_gunicorn_live]
command=/home/myusername/projectname-live/bin/django run_gunicorn -b 127.0.0.1:1559
directory=/home/myusername/projectname-live/
user=myusername
autostart=True
autorestart=True
redirect_stderr=True

链接https://gist.github.com/oaksakal/1143612

一个链接Gunicorn Supervisor Startup Error

大佬总结

以上是大佬教程为你收集整理的为gunicorn创建supervisord脚本的正确方法? Django 1.6全部内容,希望文章能够帮你解决为gunicorn创建supervisord脚本的正确方法? Django 1.6所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。