Django Rest Framework update field

The definition of what methods the endpoint can accept are done in the view, not in the serializer.

The update method you have under your serializer needs to be moved into your view so you’ll have something like:

class ClientNameSerializer(serializers.ModelSerializer):
    class Meta:
        model = ClientUser

class UpdateName(generics.UpdateAPIView):
    queryset = ClientUser.objects.all()
    serializer_class = ClientNameSerializer
    permission_classes = (permissions.IsAuthenticated,)

    def update(self, request, *args, **kwargs):
        instance = self.get_object() ="name")

        serializer = self.get_serializer(instance)

        return Response(

Take note that you’re overriding the UpdateModelMixin and you might need to change the above code a little bit to get it right.

Leave a Comment