A
A
AntonIgin2017-07-03 09:33:04
Django
AntonIgin, 2017-07-03 09:33:04

WSGIRequest: POST '/' is not JSON serializable: how to make Django, Celery and POST form friends?

The essence of the problem is described in the title. The Celery task does not accept the usual post-request results, they must be wrapped in a json object (and I don’t know anything about JS at all, I just got to the functions the other day).
How to wrap the whole post request in json I found. And what to do next? How now to use this object in my case? I tried to extract from it by the get method, and json remakes the data, apparently, into a string format.
This is what my code looks like so far:
https://pastebin.com/tKKdmZkv

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JaxxDexx, 2017-07-03
@AntonIgin

They took an object, serialized it to JSON, passed it to the target, received it in the worker, deserialized it back into an object, profit! In general, the target itself serializes the objects that you pass to it, you can even specify different types there: json (default is 4), pickle, yaml, msgpack.
Try setting a different serialization type in Celery docs.celeryproject.org/en/latest/userguide/configu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question