From de1be0d86e9896ade4a1b9d70519679898d6989f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=8F=9C?= Date: Wed, 29 Nov 2023 04:46:21 +0000 Subject: [PATCH] fix: admin login not use ldap --- FasterRunner/settings/base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FasterRunner/settings/base.py b/FasterRunner/settings/base.py index dea8e31..f811a7c 100644 --- a/FasterRunner/settings/base.py +++ b/FasterRunner/settings/base.py @@ -345,11 +345,13 @@ import ldap from django_auth_ldap.config import LDAPSearch -AUTHENTICATION_BACKENDS = ( +USE_LDAP = False # 如果需要开启LDAP认证,就设置位True + +if USE_LDAP: + AUTHENTICATION_BACKENDS = ( 'django_auth_ldap.backend.LDAPBackend', -) + ) -USE_LDAP = False # 如果需要开启LDAP认证,就设置位True AUTH_LDAP_SERVER_URI = "ldap://localhost:389" # LDAP服务器地址,默认端口389 AUTH_LDAP_BIND_DN = "cn=admin,dc=myorg,dc=com" # LDAP管理员账号