import ldap
from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion
# Baseline configuration.
AUTH_LDAP_SERVER_URI = "ldap://192.168.0.100:389"
AUTH_LDAP_BIND_DN = 'cn=caowenhao,ou=IT管理部,ou=GOA,ou=Company,dc=normstar,dc=com'
AUTH_LDAP_BIND_PASSWORD = '1qaz@WSX'
AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(
LDAPSearch("ou=IT管理部,ou=GOA,ou=Company,dc=normstar,dc=com",ldap.SCOPE_SUBTREE, "(&(objectClass=user)(sAMAccountName=%(user)s))"),
LDAPSearch("ou=jiaowu,ou=Company,dc=normstar,dc=com",ldap.SCOPE_SUBTREE, "(&(objectClass=user)(sAMAccountName=%(user)s))"),
)
AUTH_LDAP_USER_ATTR_MAP = {
"first_name": "first_name",
"last_name": "last_name",
"email": "mail"
}
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
'django.contrib.auth.backends.ModelBackend',
)在seeting.py中加入上面的配置后,登陆的时候会报错:ImportError at /login/cannot import name SiteProfileNotAvailable是哪里写的有问题吗