title: Django Python - Ldap Authentication
body: <p>I am currently work on Django Python . My aim to authenticate the user from the Ldap directory . I do have my python code to access the ldap directory and retrieve the information. </p>
  
  <p>Code :</p>
  
  <pre><code>import ldap
  try:
          l = ldap.open("ldap.forumsys.com")
          l.protocol_version = ldap.VERSION2
          username = "cn=read-only-admin,dc=example,dc=com"
          password = "password"
          l.simple_bind(username,password)
  
  except ldap.LDAPError,e:
          print e
  </code></pre>
  
  <p>My doubt is that , how would i implement this in my django? . How do use these code in django and to implement it? </p>
  
  <p>Thanks in advance</p>