just override the create and update methods of the serializer:
def create(self, validated_data): user = get_user_model(**validated_data) user.set_password(validated_data['password']) user.save() return user def update(self, instance, validated_data): for f in UserSerializer.Meta.fields + UserSerializer.Meta.write_only_fields: set_attr(instance, f, validated_data[f]) instance.set_password(validated_data['password']) instance.save() return instance