code: def validate_username(self, value):
          
          try:
              self.user = User.objects.get(username=value)
          except User.DoesNotExist:
              raise serializers.ValidationError("User does not exist")
  
          return value
docs: Verify that the username has a matching user.