This will output python dicts instead of JSON code. They might be similar but can be incompatible in some scenarios.
I would use something like this: https://djangosnippets.org/snippets/201/