Django-celery 弃用错误?
我刚刚启动 django-celery 并收到此警告:
DeprecationWarning:
The `celery.decorators` module and the magic keyword arguments
are pending deprecation and will be deprecated in 2.4, then removed
in 3.0.
`task.request` should be used instead of magic keyword arguments,
and `celery.task.task` used instead of `celery.decorators.task`.
See the 2.2 Changelog for more information.
这是我的测试任务:
from celery.decorators import task
@task()
def myProcessingFunction():
print "Zing!"
return 1
我从视图中调用它:
myProcessingFunction.delay()
我找不到此错误的任何文档。这是怎么回事?
I just started up django-celery and got this warning:
DeprecationWarning:
The `celery.decorators` module and the magic keyword arguments
are pending deprecation and will be deprecated in 2.4, then removed
in 3.0.
`task.request` should be used instead of magic keyword arguments,
and `celery.task.task` used instead of `celery.decorators.task`.
See the 2.2 Changelog for more information.
Here's my test task:
from celery.decorators import task
@task()
def myProcessingFunction():
print "Zing!"
return 1
I'm calling it from a view with:
myProcessingFunction.delay()
I can't find any documentation for this error. What's going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它告诉您,您正在使用的装饰器 (task()) 将从 celery 的后续版本中删除,因此您应该考虑将其从代码中删除:
所以
It's telling you that the decorator you are using (task()) is going to be taken out of subsequent versions of celery so you should look to remove it from your code:
so
根据 http://docs.celeryproject.org/en /latest/internals/deprecation.html#old-task-api 听起来你现在也应该更改
为
According to http://docs.celeryproject.org/en/latest/internals/deprecation.html#old-task-api it sounds like you should also now change
to