Answers for "Invalid password format or unknown hashing algorithm."

0

Invalid password format or unknown hashing algorithm.

ou need to use the django.contrib.auth.hashers.check_password,

class CreateUser(APIView):
    permission_classes = [AllowAny]

    def post(self, request, format='json'):
        print(request.data)
        data = request.data
        reg_serializer = RegisterUserSerializer(data=data)
        if reg_serializer.is_valid():
            password = reg_serializer.validated_data.get('password')
            reg_serializer.validated_data['password']=make_password(password)
            new_user = reg_serializer.save()
            if new_user:
                return Response(status=status.HTTP_201_CREATED)
        return Response(reg_serializer.errors,status=status.HTTP_400_BAD_REQUEST)
Posted by: Guest on August-19-2021
0

Invalid password format or unknown hashing algorithm. simple jwt

remove from your code
extra_kwargs = {"password": {"write_only": True}}
Posted by: Guest on August-17-2021

Code answers related to "Invalid password format or unknown hashing algorithm."

Browse Popular Code Answers by Language