• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Problem in logging in the user in django webpage

Resolved: Problem in logging in the user in django webpage

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have issues with creating a login page in django. I am done with the views and html and stuff but the issue is that when I hit login it won’t log the user in. After some debugging I saw that the issue is that the value of the user is None but I don’t know why
If anyone could help me with this it would be great
i am posting the code below:
views:-
html:-
signals:-
models:-
Well this is all of it and i think it might have been a bit much but never mind Please someone, if you would help me with this it would be a great help
Ohh right and the output is:- The email or password is incorrect (The current output)

Answer:

According to the doc, the authenticate method doesn’t require a request object. Furthermore, I’d suggest using the username in the parameter as well instead of the email since you are using the django User model.
Also, you might want to tweak the code you have to kinda facilitate using the username. For example, within the if request.method == 'POST': block:
That’s an approach you could take.

If you have better answer, please add a comment about this, thank you!

django html python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Why reference in pointer array doesn’t have data?

24/03/2023

Resolved: EntityFramework creates/runs migrations using parameterless DataContext instance

24/03/2023

Resolved: Visual Studio 2022 crashes when using breakpoints

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.