Celery 找不到我的 django 模块

问题描述 投票:0回答:0

当我尝试使用命令 celery -A blogger.celery worker 启动 celery 时,我遇到了以下错误。我正在从我的包目录运行命令,我的 celery.py

ModuleNotFoundError:没有名为“blogger”的模块

————————
blogger/celery.py
from celery import Celeryfrom django.conf import settings
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blogger.settings")
app = Celery('blogger')
app.conf.enable_utc = Falseapp.conf.update(timezone='Asia/kolkata')
app.config_from_object(settings, namespace='CELERY')

——————
blogger/init.py
from .celery import app as celery_app
all = ('celery_app', )
————————
blogger/setting.py
CELERY_BROKER_URL = 'redis://127.0.0.1:6379'CELERY_ACCEPT_CONTENT = ['application/json']CELERY_RESULT_SERIALIZER = 'json'CELERY_TASK_SERIALIZER = 'json'CELERY_TIMEZONE = 'Asia/kolkata'CELERY_RESULT_BACKEND = 'django-db'CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler'—————————

请帮我解决这个错误

请帮我解决这个问题

python django redis celery django-celery
© www.soinside.com 2019 - 2024. All rights reserved.