Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)

Comment

Invalid password format or unknown hashing algorithm. simple jwt

remove from your code
extra_kwargs = {"password": {"write_only": True}}
Comment

PREVIOUS NEXT
Code Example
Python :: pandas currency to numbe 
Python :: send mail through python 
Python :: openpyxl read sheet row by row 
Python :: str replace pandas 
Python :: os.chdir go back 
Python :: Pandas conditional collumn 
Python :: python if type dict 
Python :: numpy generate random array 
Python :: install simple audio in python 
Python :: remove brases from array py 
Python :: parse int python 
Python :: how to cut image python 
Python :: enumarate in python 
Python :: pyjwt 
Python :: parallel loops in python 
Python :: Set value for particular cell in pandas DataFrame using index 
Python :: plot data python 
Python :: combine dictionaries, values to list 
Python :: detailview 
Python :: python qt always on top 
Python :: gaussian filter 
Python :: react-native-dropdown-picker 
Python :: python find string in list 
Python :: how to download from url in python 
Python :: python for android 
Python :: Creating and writing to a new file 
Python :: python discord mention user 
Python :: pyton count number of character in a word 
Python :: List Delete a Element 
Python :: seaborn color palette python 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =