5👍
✅
Set allow_null=True
in your serializer:
class MyModelSerializer(serializers.ModelSerializer):
my_data = serializers.JSONField(allow_null=True)
In DRF allow_null
is False
by default, even if your model is configured to accept null
.
Source:stackexchange.com