Good afternoon! A little confused in the authorization model of the user from another database.
backends.py class TestAuthenticationBackend(object): def authenticate(self, username=None, password=None): cursor = connection.cursor() cursor.execute("select * from system_accounts where is_deleted=0 and \ login='{0}' and password='{1}'".format(username,password)) user = cursor.fetchone() return user views.py def login_view(request): if request.method == 'POST': username = request.POST['username'] password = request.POST['password'] user = authenticate(username=username,password=password) return auth_views.login(request, 'accounts/login.html') settings.py AUTHENTICATION_BACKENDS = ('accounts.backends.TestAuthenticationBackend',) As a result, I get the error:
AttributeError: 'tuple' object has no attribute 'backend'