Answer the question
In order to leave comments, you need to log in
Problem when running celery with Flask. What is the problem?
My flask app:
from flask import Flask
from celery import Celery
app = Flask(__name__)
app.debug = True
app.config['CELERY_BROKER_URL'] = 'mongodb://логин:пароль@ds243041.mlab.com:43041/flaskmongodb'
app.config['CELERY_RESULT_BACKEND'] = 'mongodb://логин:пароль@ds243041.mlab.com:43041/flaskmongodb'
celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config
@app.route('/run_Task')
def run_celery_task():
my_task.delay()
return 'Задача запущена'
@celery.task(name='app.my_task')
def my_task():
return 'task completed'
if __name__ == '__main__':
app.run()
Answer the question
In order to leave comments, you need to log in
Cannot mix new setting names with old setting name...
in Celery, the format has changed, you need all the parameters to be called either in the old or in the new way
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question