Django Rest Framework ImageField
I think you can use request.data
instead after django rest framework 3.0
. The usage of request.DATA
and request.FILES
is now pending deprecation in favor of a single request.data
attribute that contains all the parsed data.
You can check it from here
You seem to be missing the request.FILES
argument to the serializer constructor in the your post
and put
handlers.
serializer = PhotoSerializer(data=request.DATA, files=request.FILES)