Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback:
- File "D:Pythonlibsite-packagesdjangocorehandlersexception.py" in inner
- 35 response = get_response(request)
- File "D:Pythonlibsite-packagesdjangocorehandlersbase.py" in _get_response
- 128 response = self.process_exception_by_middleware(e, request)
- File "D:Pythonlibsite-packagesdjangocorehandlersbase.py" in _get_response
- 126 response = wrapped_callback(request, *callback_args, **callback_kwargs)
- File "d:ProgramsPythonDjangotest2accountsviews.py" in login_user
- 52 user = authenticate(request=request, email=email, password=password)
- File "D:Pythonlibsite-packagesdjangocontribauth__init__.py" in authenticate
- 70 user = _authenticate_with_backend(backend, backend_path, request, credentials)
- File "D:Pythonlibsite-packagesdjangocontribauth__init__.py" in _authenticate_with_backend
- 116 return backend.authenticate(*args, **credentials)
- File "d:ProgramsPythonDjangotest2accountsbackends.py" in authenticate
- 29 if MyUser.check_password(password):
- Exception Type: TypeError at /accounts/login/
- Exception Value: check_password() missing 1 required positional argument: 'raw_password'
- class EmailAuthenticationBackend(ModelBackend):
- def authenticate(self, request, email=None, password=None):
- MyUser = get_user_model()
- try:
- # Check the email/password and return a user
- user = MyUser.objects.get(email=email)
- # BUG
- if MyUser.check_password(password):
- return user
- except MyUser.DoesNotExist:
- return None
- def login_user(request):
- template_name = 'registration/login.html'
- if request.method == 'POST':
- email = request.POST['email']
- password = request.POST['password']
- user = authenticate(request=request, email=email, password=password)
Add Comment
Please, Sign In to add comment