6๐
โ
Try this in your serializer:
class ApiLogSerializer(serializers.ModelSerializer):
incoming_data = serializers.JSONField() # change is here
class Meta:
model = ApiLog
fields = ('incoming_data',)
This will convert your JSON
dict to string and store in DB as Text
.
Refer to the official DRF documentation for more details
๐คJPG
0๐
try with quotes?:
data = {...,
'incoming_data':'{"key1":"value1","key2":"value2"}'
}
๐คoj43085
- [Django]-Django celery: Import error โ no module named task
- [Django]-Internationalizing images in django
- [Django]-How to add multiple attrs in Django forms
Source:stackexchange.com