A
A
Andrei1penguin12020-12-28 22:17:29
Django
Andrei1penguin1, 2020-12-28 22:17:29

Why does auth.authenticate return None?

Good day, the question would seem painfully simple, but I'm stuck
When a user in the database enters the site (request.user = AnonymousUser) and then authorizes him

user = auth.authenticate(username=login, password=password)
auth.login(request, user)

The error " 'AnonymousUser' object has no attribute '_meta' " is returned.
In this case, auth.authenticate returns None, even though the password with the login is correct
. What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question