[Answer]-Django can't serialize non-model on post


You need to be accessing ‘serializer.is_valid()’ before accessing the data. Looks like there’s a missing bit of API there – serializer.data should probably raise an expection if its accessed before validation.


Seems you are not using Django’s serializers but anyway serialization is not made for validation. Use forms to validate your data then use json as you do to serialize it. Django’s serializers are for querysets and models only.


Leave a comment