title: LDAP in Django 1.5 & Python 3
body: <p>I am using Django 1.5 and Python 3. I am new to Django &amp; LDAP in general. </p>
  
  <p>I am including the following configuration (modified for my case) in my <code>settings.py</code> file, which was taken from <a href="https://stackoverflow.com/questions/6860943/importing-ldap-users-into-django-database">here</a>:</p>
  
  <pre><code>AUTH_LDAP_SERVER_URI = "ldap://example.fr"
  
  AUTH_LDAP_BIND_DN = 'cn=a_user,dc=example,dc=fr'
  AUTH_LDAP_BIND_PASSWORD=''
  AUTH_LDAP_USER_SEARCH = LDAPSearch('ou=users,dc=example,dc=fr', ldap.SCOPE_SUBTREE, '(uid=%(user)s)')
  AUTH_LDAP_GROUP_SEARCH = LDAPSearch('ou=groups,dc=example,dc=fr', ldap.SCOPE_SUBTREE, '(objectClass=groupOfNames)')
  
  AUTH_LDAP_GROUP_TYPE = ActiveDirectoryGroupType()
  
  #Populate the Django user from the LDAP directory
  AUTH_LDAP_USER_ATTR_MAP = {
      'first_name': 'sAMAccountName',
      'last_name': 'displayName',
      'email': 'mail'
  }
  
  
  AUTHENTICATION_BACKENDS = (
      'django_auth_ldap.backend.LDAPBackend',
      'django.contrib.auth.backends.ModelBackend',
  )
  </code></pre>
  
  <p>However, I have also followed the discussion <a href="https://groups.google.com/forum/#!topic/django-auth-ldap/T80u61-ZM5k" rel="nofollow noreferrer">here</a> where it says that, the <code>django-auth-ldap</code> module is not ported to Python 3. </p>
  
  <p>I have a couple of questions:</p>
  
  <ol>
  <li><p>What are the module imports that need to go into the <code>settings.py</code> file in order to get the configuration above to work?</p></li>
  <li><p>Which of those imports are not available for Python 3?</p></li>
  <li><p>Is it possible to get LDAP-based authentication going for Django with Python 3? Is it some modification of the approach above, or something different?</p></li>
  </ol>
  
  <p>Any advice appreciated. </p>