Convert string to json datatype before send back JSON API to client in Django Rest Framework

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Convert string to json datatype before send back JSON API to client in Django Rest Framework



I have json structure data stored into sqlite as string.(Because sqlite does not support data type json) Thus, when JSON API request come, this json structure data is returned as string as shown below image. However, I want to convert string to json at server side and send to client as json data type. Does anyone know how I can implement?
enter image description here





Possible duplicate of Django REST framework: create JSON fragments from string
– JackNavaRow
Aug 9 at 11:58




1 Answer
1



You could use serializers.JSONField


serializers.JSONField


class MyserializerClass(serializers.Serializer):
# your code
json = serializers.JSONField()






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered