'DisabledBackend' 对象没有属性 '_get_task_meta_for'
'DisabledBackend' object has no attribute '_get_task_meta_for'
我收到错误消息“'DisabledBackend' 对象没有属性 '_get_task_meta_for'”../
这是 django settings.py
# celery settings
CELERY_RESULT_BACKEND = 'amqp'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
而且,这是 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)
我用
在 ubuntu linux 上安装了 rabbitmq
$>sudo apt-get install rabbitmq-server
但是,此代码在 mac OSX 中工作得很好!!
不适用于 linux-ubuntu..
我必须安装 "elang"??
我想我没有弄错 'settings.py' 和 'celery.py'.
我从来不知道哪里出了问题。
我发现我的错误是什么:我必须将这些代码写入我的项目文件夹中的 __init__.py
。
from __future__ import absolute_import, unicode_literals
from .celery import app as celery_app
__all__ = ['celery_app']
我收到错误消息“'DisabledBackend' 对象没有属性 '_get_task_meta_for'”../
这是 django settings.py
# celery settings
CELERY_RESULT_BACKEND = 'amqp'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
而且,这是 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)
我用
在 ubuntu linux 上安装了 rabbitmq$>sudo apt-get install rabbitmq-server
但是,此代码在 mac OSX 中工作得很好!!
不适用于 linux-ubuntu..
我必须安装 "elang"??
我想我没有弄错 'settings.py' 和 'celery.py'.
我从来不知道哪里出了问题。
我发现我的错误是什么:我必须将这些代码写入我的项目文件夹中的 __init__.py
。
from __future__ import absolute_import, unicode_literals
from .celery import app as celery_app
__all__ = ['celery_app']