Created
February 6, 2017 00:45
-
-
Save jtallieu/50ded0961d2ffbbc6b0ea675ca06ac7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def connect(args): | |
con = initialize(args['NAME'], karma=0.001) | |
con.simple_bind_s(args['USER'], args['PASSWORD']) | |
return con | |
pool = DBPool.ConnectionPool( | |
connect, { | |
'NAME': 'ldap://ldapserver', | |
'USER': 'xxxxxxx', | |
'PASSWORD': 'xxxxx', | |
}, { | |
'maxconn': 40, | |
'minconn': 4, | |
'minkeepsecs': 300 | |
}) | |
DBPool.initpool(pool) | |
DATABASES = { | |
'ldap': { | |
'ENGINE': 'ldapdb.backends.ldap', | |
'POOL': DBPool.dbpool(), | |
}, | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'NAME': 'ldapdb.db', | |
'USER': '', | |
'PASSWORD': '', | |
'HOST': '', | |
'PORT': '', | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment