I've configured celery to use json in the following manner:
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
However, when the worker receives the task it generates the following error:
ContentDisallowed: Refusing to deserialize untrusted content of type pickle (application/x-python-serialize)
Is there something I am missing that's undocumented perhaps.
The problem is celery is accepting as json
and while sending a task its sending content as pickle
hence the error.
As mentioned here while calling you will have to specify serializer ( which is json
by default since celery 4.0 )
add.apply_async((10, 10), serializer='json')
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