On Thu, May 22, 2008 at 10:01 AM, Cliff <[EMAIL PROTECTED]> wrote: > > I've got an LDAPBackend.py implementing a class for LDAP > authentiction. But I can't seem to get it to be used in my Django > project. > > I am putting the LDAPBackend.py in the root directory of my project, > right next to the settings.py file. > > In settings.py, I set > AUTHENTICATION_BACKENDS = ( > 'django.contrib.auth.backends.ModelBackend', > 'LDAPBackend' > ) > > > But I getting an ImproperlyConfigured exception. > Error importing authentication backend LDAPBacken: "No module named > LDAPBacken" > > I guess I'm not understanding how the entries in > AUTHENTICATION_BACKENDS map to the directory structure of my project. > > Also, why is the error message chopping off the 'd' in LDAPBackend? > Am I doing something wrong to cause that? >
If you take a look at the code that loads the authentication backends ( http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/__init__.py#L8) you'll see it assumes there is at least one '.' in each string of AUTHENTICATION_BACKENDS. So, moving your LDAPBackend into a module underneath the root of your project should fix your problem. I'd say there's a bit of a bug in Django here, though. Either that code should handle dotless strings, or give a better indication of the problem. The symptom of having the last letter of your backend string chopped off is pretty mysterious. Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

