I have an email sending tasks running in celery shared task. i am passing a python list into html template. but celery converts this list into string. but without using celery task , i am getting actual list.
From the docs you can read:
Data transferred between clients and workers needs to be serialized, so every message in Celery has a content_type header that describes the serialization method used to encode it.
The default serializer is JSON, but you can change this using the task_serializer setting, or for each individual task, or even per message.
As serializers, you can use also pickle
, yaml
and msgpack
but the data, MUST be serialized.
Serialization is mandatory, just keep in mind tasks will be communicating using JSON (that's your case) and de-serialize the data before using it.