djangorestframework serializer errors: {u'non_field_errors': [u'No input provided']}
This video explains
djangorestframework serializer errors: {u'non_field_errors': [u'No input provided']}
--
Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Lost Civilization
--
Chapters
00:00 Question
01:05 Accepted answer (Score 20)
01:43 Thank you
--
Full question
https://stackoverflow.com/questions/2062...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #serialization #djangomodels #djangorestframework
#avk47
djangorestframework serializer errors: {u'non_field_errors': [u'No input provided']}
--
Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Lost Civilization
--
Chapters
00:00 Question
01:05 Accepted answer (Score 20)
01:43 Thank you
--
Full question
https://stackoverflow.com/questions/2062...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #serialization #djangomodels #djangorestframework
#avk47
ACCEPTED ANSWER
Score 20
You're providing a person instance to be updated by the serializer, but no accompanying data to update that instance with.
If you want to deserialize some request data to update that instance with then you're missing the data argument, for example:
PersonSerializer(person, data=request.DATA, partial=True)
However it sounds like the endpoint you want doesn't actually expect to deal with any input data (it's just an empty PUT request you're making right?) In which case you don't want/need to be using a serializer at all.