creating users with Django REST Framework - not authenticate
问题 I am working with Django users, and I've hashed the passwords when I create an user with Django REST Framework and I override the create and update methods on my serializer to hash my passwords users class UserSerializer(serializers.ModelSerializer): #username = models.CharField() def create(self, validated_data): password = validated_data.pop('password', None) instance = self.Meta.model(**validated_data) if password is not None: instance.set_password(password) instance.save() return instance