Relative Content

Tag Archive for djangoauthentication

Django URL reset after authentication fail

if user is not None: login(request, user) return redirect(‘home’) else: error_message = “Invalid username or password.” return render(request, ‘login.html’, {‘error_message’: error_message}) Using the above code, if user enters wrong credentials, login.html shows up successfully with error message. But now the URL is http://localhost:8000/authentication_view/. Now if the user re-enters credentials, the URL will be http://localhost:8000/authentication_view/authentication_view/, and […]