title: Django user authentication: django_auth_ldap.backend.LDAPBackend
body: <p>I don't understand how to use the LDAPBackend in django, all I want to do is to authenticate a user against LDAP. I have tried the following:</p>
  
  <pre><code>from django_auth_ldap.backend import LDAPBackend
  auth = LDAPBackend()
  user = auth.authenticate(username='my_uid',password='pwd')
  </code></pre>
  
  <p>At this point user is None and looking at tcpdump I can't see any connection attempt to the LDAP server.</p>
  
  settings.py
  
  <pre><code>AUTH_LDAP_SERVER_URI = 'ldap.example.com'
  AUTH_LDAP_USER_DN_TEMPLATE = 'uid=%(user)s,ou=People,dc=example,dc=com'
  AUTH_LDAP_BIND_AS_AUTHENTICATING_USER = True
  AUTH_LDAP_CACHE_GROUPS = True
  AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600
  AUTH_LDAP_USER_ATTR_MAP = {
  "first_name": "givenName",
  "last_name": "sn",
  "email": "mail"
  }
  AUTHENTICATION_BACKENDS = (
  'django.contrib.auth.backends.ModelBackend',
  'django_auth_ldap.backend.LDAPBackend',
  )
  </code></pre>
  
  <p>The official django doc doesn't provide any snippet about how to use this backend in a view. </p>
  
  <p>Many thanks for your help!</p>