“与主管一起运行Celery时找不到模块” >> [

问题描述 投票:0回答:1
我正在尝试使用主管与django一起运行celery。

supervisor_celery.conf

[program:supervisor-celery] command=/home/user/project/virtualenvironment/bin/celery worker -A project --loglevel=INFO directory=/home/user/project/project user=nobody numprocs=1 stdout_logfile=/home/user/project/logs/celery.log stderr_logfile=/home/user/project/logs/celery.log autostart=true autorestart=true startsecs=10 stopwaitsecs = 600 stopasgroup=true priority=1000

正在运行的主管,在日志文件中出现以下错误:-

Unable to load celery application. The module project was not found.

项目结构是

project |-project |-settings |-production.py |-__init__.py |-celery.py |-urls.py |-wsgi.py |-app

__init__.py的内容是:-

from __future__ import absolute_import, unicode_literals from .celery import app as celery_app __all__ = ('celery_app',)

celery.py的内容是

from __future__ import absolute_import, unicode_literals import os from celery import Celery os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings.production') app = Celery('project') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks()

如果有人可以告诉我为什么它不起作用,这将很有帮助?

我正在尝试使用主管与django一起运行芹菜。 Supervisor_celery.conf [program:supervisor-celery] command = / home / user / project / virtualenvironment / bin / celery worker -A project --loglevel = INFO ...

django celery supervisord django-supervisor
1个回答
0
投票
似乎您的目录错误(在supervisor conf中,应该是
© www.soinside.com 2019 - 2024. All rights reserved.