Reputation: 117
I get the error "'DisabledBackend' object has no attribute '_get_task_meta_for'"../
Here is the django settings.py
# celery settings
CELERY_RESULT_BACKEND = 'amqp'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
And, this is the celery.py
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
from django.conf import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', proj.settings)
app = Celery('proj', backend='amqp', broker='amqp://guest:guest@localhost:5672//')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
I installed rabbitmq on ubuntu linux with
$>sudo apt-get install rabbitmq-server
But, this codes work very well in mac OSX!!
Not work on linux-ubuntu..
Do I have to install "elang"??
I think I didn't mistake at 'settings.py' and 'celery.py'.
I never know that what is wrong.
Upvotes: 0
Views: 4020
Reputation: 117
I found that what was my mistake: I had to write these code to __init__.py
in my project folder.
from __future__ import absolute_import, unicode_literals
from .celery import app as celery_app
__all__ = ['celery_app']
Upvotes: 3