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')
#Login issue
6 messages · Page 1 of 1 (latest)
And the issue is ...?
you could just use the default login view and forms
ah the issue is doen but got anew one
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
Whas the error/ traceback?