How can i pass django request object to celery worker. When try to pass the request object it throws a Error
Can't Pickle Input Objects
It seems that celery serialize any arguments passed to worker. I tried using other serialization methods like JSON.
CELERY_TASK_SERIALIZER = "JSON"
But it is not working.
Is it possible to configure celery so that it won't serialize data. Or can i convert request object to a string before passing to worker and then convert again back to object in worker.
Thanks in advance...
You can't pickle Django's request objects (see this question for more details). Instead you should pass the relevant information from the request object that you need to the Celery tasks.
You should have no problem passing other information to a Celery task as most objects can be pickled without a problem.
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