7
Orionss
7y

It's sad because Django is a really great framework, but I can't understand how their serializers work.
I finally tricked to make my own using JsonResponse and alternatives methods, but I can't see why there is "serializers", "DjangoJSONEncoder", "JsonResponse", "json.dumps" and so on...

The documentation doesn't explain much about it :/

Comments
  • 1
    Are you using the REST framework?
  • 0
  • 0
    It's... vague. My advice is look for examples on github.
  • 2
    JsonResponse is a special http response that accepts JSON input. json.dumps will convert python types to json, serializers do the same under the hood, but based on how you configure them. Most of the time it's worth having a look at how at the source code to see what they actually do. The source code is your second best place to look when something is unclear 😉
  • 1
    @620hun I don't know why but I can't find the patience to look into a source code. I feel always totally lost and I give up quickly
  • 0
    I worked on mantidproject/webapp which used Django serializers. Maybe you can find something useful in there.
Add Comment