【发布时间】:2011-10-01 10:57:01
【问题描述】:
我正在使用 django-celery,我想将 TASK_SERIALIZER 设置为 JSON 而不是 pickle。
我可以通过更改我的任务装饰器来在每个方法的基础上做到这一点
@task
到
@task(serializer="json")
但我想在全球范围内进行。设置
TASK_SERIALIZER="json"
在settings.py 中不起作用。尝试运行
import celery
celery.conf.TASK_SERIALIZER="json"
(暗示here)导致
AttributeError: 'module' object has no attribute 'conf'
知道如何在通过 django 运行 celery 时配置此设置吗?
【问题讨论】:
标签: python django celery django-celery