Skip to content
Snippets Groups Projects
Commit 7aeaf1b6 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-139: minor tweaks

parent 19badd98
No related branches found
No related tags found
1 merge request!96Resolve TMSS-139
......@@ -13,12 +13,7 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
import os
import ldap
import logging
from lofar.common import dbcredentials
# logger
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
from lofar.common import dbcredentials, isDevelopmentEnvironment
LOGGING = {
'version': 1,
......@@ -64,17 +59,16 @@ LOGGING = {
'level': 'DEBUG',
'propagate': False,
},
'django_auth_ldap': {
'handlers': ['console'],
'level': 'INFO',
},
}
}
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '-&$!kx$_0)u1x#zk9w^^81hfssaover2(8wdq_8n8n3u(8=-9n' # todo: set something new here for production !!!
......@@ -208,7 +202,7 @@ AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NE
# AUTH_LDAP_BIND_DN = '' # our LDAP is open
# AUTH_LDAP_BIND_PASSWORD = '' # our LDAP is open
protocol = 'ldaps://'
if 'test' in ldap_creds_name:
if isDevelopmentEnvironment():
logging.warning('Test ldap credentials detected, using insecure connection for ldap autenthication') # mock LDAP does not support ldaps://
protocol = 'ldap://'
AUTH_LDAP_SERVER_URI = "%s%s:%s" % (protocol, django_ldap_credentials.host, django_ldap_credentials.port)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment