#Login issue

6 messages · Page 1 of 1 (latest)

sick harness
#
def user_login(request):
    if request.method == 'POST':
        username = request.POST['username']
        password = request.POST['password']
        print("Username:", username)
        print("Password:", password)
        user = authenticate(request, username=username, password=password)
        print(user)
        if user :
            print("login atemptt...")
            login(request, user)
            return redirect('dasboard')  # Redirect to the dashboard after successful login
        else:
            print("Invalid login attempt")  # Debugging message
            # Handle invalid login
            # For example, you can render the login page again with an error message
            return render(request, 'login_signup/login.html', {'error': 'Invalid username or password'})
    else:
        return render(request, 'login_signup/login.html')
patent pier
#

And the issue is ...?

ripe karma
#

you could just use the default login view and forms

sick harness
#

this time i am taking input from user in a form and trying to store the data but for some reason its not storing it