【发布时间】:2019-11-16 11:13:27
【问题描述】:
我正在使用带有 celery 4.2.1 和 django2 的 django-celery-beat。
起初它运行良好,但在 gunicorn 日志中显示一段时间后出现以下错误
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gunicorn/arbiter.py", line 515, in spawn_worker
worker.init_process()
File "/usr/lib/python3/dist-packages/gunicorn/workers/base.py", line 122, in init_process
self.load_wsgi()
File "/usr/lib/python3/dist-packages/gunicorn/workers/base.py", line 130, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/lib/python3/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/lib/python3/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/lib/python3/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/lib/python3/dist-packages/gunicorn/util.py", line 366, in import_app
__import__(module)
File "/var/infra/app/smartwaypanel-backend/src/restfull_api/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/apps/registry.py", line 112, in populate
app_config.import_models()
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.5/dist-packages/django_celery_beat/models.py", line 8, in <module>
from celery.five import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible'
这是一种非常奇怪的行为,我找不到更多信息。
【问题讨论】:
标签: django gunicorn django-celery supervisord celerybeat