tasks.py:
from celery import Celery
app = Celery('tasks', broker='amqp://guest@localhost//')
@app.task
def add(x, y):
return x + y
call.py:
from tasks import add
result = add.delay(1, 4)
result.ready()
celeryconfig.py: (in the same directory)
BROKER_URL = 'amqp://guest@localhost//'
CELERY_RESULT_BACKEND = 'amqp://guest@localhost//'
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT=['json']
CELERY_TIMEZONE = 'Europe/Oslo'
CELERY_ENABLE_UTC = True
In call.py I have en error:
AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'
I read the docs, I have result backend, why it does not work? How to fix that?
Thanks!