前言
flask + celery 启动celery服务时报错:
Unable to load celery application.
The module app.celery was not found.
问题描述
执行启动celery worker 命令
celery -A app.celery worker -l info
结果出现报错Unable to load celery application
解决方案
我的app.py代码
from flask import Flask
from celery import Celery
# 基本配置
broker_url = 'redis://localhost:6379'
result_backend = 'redis://localhost:6379'
app = Flask(__name__)
celery_app = Celery(app.import_name,
broker=broker_url,
backend=