summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--requirements.txt2
-rw-r--r--sublab_project/settings.py23
2 files changed, 25 insertions, 0 deletions
diff --git a/requirements.txt b/requirements.txt
index 2bd7e3d..7d55e8a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,3 +3,5 @@ South==0.7.3
gunicorn==0.13.4
creole==1.2
PIL==1.1.7
+django-auth-ldap==1.0.14
+python-ldap==2.4.6
diff --git a/sublab_project/settings.py b/sublab_project/settings.py
index b748f3e..d35e5c7 100644
--- a/sublab_project/settings.py
+++ b/sublab_project/settings.py
@@ -1,6 +1,10 @@
# Django settings for sublab_project project.
import os
+# from django_auth_ldap.config import LDAPSearch
+# import ldap
+
+
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
@@ -166,6 +170,25 @@ LOGGING = {
}
}
+# AUTH_LDAP_SERVER_URI = 'ldap://taifun.local.sublab.org'
+# AUTH_LDAP_BIND_DN = 'cn=djangotest,ou=users,dc=sublab,dc=org'
+# AUTH_LDAP_BIND_PASSWORD = 'djangotest'
+# AUTH_LDAP_USER_SEARCH = LDAPSearch('ou=users,dc=sublab,dc=org',
+# ldap.SCOPE_SUBTREE, '(uid=%(user)s)')
+AUTH_LDAP_USER_DN_TEMPLATE = 'uid=%(user)s,ou=users,dc=sublab,dc=org'
+AUTH_LDAP_USER_ATTR_MAP = {
+ 'first_name': 'givenName',
+ 'last_name': 'sn',
+ 'email': 'mail'
+}
+AUTH_LDAP_ALWAYS_UPDATE_USER = True
+AUTH_LDAP_START_TLS = True
+
+AUTHENTICATION_BACKENDS = (
+ 'django_auth_ldap.backend.LDAPBackend',
+ 'django.contrib.auth.backends.ModelBackend',
+)
+
try:
from local_settings import *
except ImportError: