Merge pull request #384 from arachnys/var-handling-for-AUTH_LDAP

Use booleans for AUTH_LDAP setting
This commit is contained in:
Matthew Brown 2016-10-06 16:16:28 +01:00 committed by GitHub
commit 689449f866
1 changed files with 3 additions and 2 deletions

View File

@ -246,9 +246,10 @@ REST_FRAMEWORK = {
AUTHENTICATION_BACKENDS = ( AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', 'django.contrib.auth.backends.ModelBackend',
) )
AUTH_LDAP = os.environ.get('AUTH_LDAP', 'false')
if AUTH_LDAP.lower() == "true": AUTH_LDAP = os.environ.get('AUTH_LDAP', False)
if AUTH_LDAP:
from settings_ldap import * from settings_ldap import *
AUTHENTICATION_BACKENDS += tuple(['django_auth_ldap.backend.LDAPBackend']) AUTHENTICATION_BACKENDS += tuple(['django_auth_ldap.backend.LDAPBackend'])