The problem of authenticate () function in auth Module in django

this module is used to authenticate users

from django.contrib.auth import authenticate

A few days ago, you can use user = authenticate (username=username, password=password)
to return a user, but today you try to return None

.

the following problems recur

clipboard.png

username, password, email

clipboard.png

clipboard.png

user check_password()

clipboard.png

authenticate()

clipboard.png

clipboard.png

usercheck_password()True

clipboard.png

this question is very perplexing. I would like to ask you for advice.

Mar.04,2021

check to see if django.contrib.auth.middleware.AuthenticationMiddleware is enabled in MIDDLEWARE_CLASSES

another best way to debug is to see the breakpoint step by step to see what the reason is


check whether the is_active of the created user is 1. If not, the password is not valid when using authenticate authentication

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be0fa6-3154c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be0fa6-3154c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?