From b04937174280587ceb39c598125f468cf0d88911 Mon Sep 17 00:00:00 2001 From: Entrouvert Date: Mon, 12 May 2014 13:45:55 +0000 Subject: [PATCH] complete settings.py with LDAP configuration --- settings.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/settings.py b/settings.py index 27f8f81..1b5cee3 100644 --- a/settings.py +++ b/settings.py @@ -3,7 +3,7 @@ DATABASES = { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'authentic2', 'USER': 'authentic2', - 'PASSWORD': '', + 'PASSWORD': '{PASSWORD}', 'HOST': 'localhost', } } @@ -11,3 +11,28 @@ INSTALLED_APPS=('django.contrib.auth',) AUTHENTICATION_BACKENDS=('django.contrib.auth.backends.ModelBackend', 'authentic2.backends.ldap_backend.LDAPBackend') SECRET_KEY='xxx' +LDAP_AUTH_SETTINGS=[ + { + "url": "ldaps://ldap.libre-entreprise.org/", + "basedn": "o=entrouvert,ou=companies,o=libre-entreprise", + "user_filter": "uid=%s", + "groupsu": ["cn=ldapadmins,ou=groups,o=entrouvert,ou=companies,o=libre-entreprise"], + "groupstaff": ["cn=ldapadmins,ou=groups,o=entrouvert,ou=companies,o=libre-entreprise"], + "group_filter": "(&(uniqueMember={user_dn})(objectClass=legroup))", + "transient": False, + "realm": "entrouvert.org", + "create_group": True, + "group_mapping": [ + ["cn=ldapadmins,ou=groups,o=entrouvert,ou=companies,o=libre-entreprise", [ "Superutilisateur" ]] + ], + "attributes": ["sn", "givenName", "mail"] + } +] + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': '/var/cache/authentic2', + }, +} +