On Thu, Oct 16, 2008, Daniele Procida <[EMAIL PROTECTED]> wrote: >I'm trying to get django.contrib.auth.ldapauth.LDAPBackend - from: > ><http://code.djangoproject.com/attachment/ticket/2507/ldapauth.py> > >working with our LDAP server. > >However, if we set any value in LDAP_OPTIONS (other than 'None' - and >even the one in the example above) we get an error: > >Exception Value: > 'dict' object has no attribute 'LDAP_OPTIONS' >Exception Location: > /usr/lib/python2.5/site-packages/django/contrib/auth/ldapauth.py in >authenticate, line 113
OK - I seem to have found the problem. Line 113 of ldapauth.py: self.ldap.set_option(k, self.settings.LDAP_OPTIONS[k]) should be: self.ldap.set_option(k, self.settings["LDAP_OPTIONS"][k]) I presume that other instances of that syntax need to be changed. Also, the syntax for settings.py that worked for me were: import ldap LDAP_OPTIONS = 'ldap.OPT_X_TLS_DEMAND,1' I have commented on the ticket. Thanks for all the help and suggestions. Daniele --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---