class PhotoList(APIView):

    def post(self, request, format=None):
        serializer = MyPhotoSerializer(data=request.data)
if serializer.is_valid():
    serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
Django Rest Framework ImageField