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?
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:
celery.task.task
should be used instead of
celery.decorators.task`
so
from celery.task import task # instead of celery.decorators
@task()
def myProcessingFunction():
print "Zing!"
return 1
According to http://docs.celeryproject.org/en/latest/internals/deprecation.html#old-task-api it sounds like you should also now change
from celery.task import task
to
from celery import task
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With