On Nov 26, 2007 6:02 PM, tinti <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> have a really big problem getting ldap working with django.
> Tried almost everything :( My code is in the views.py :
>
> from ldap import *
> def ldapListUsers(ldap):
>     """List all ldap users"""
>     l = ldap.initialize("ldap://localhost:389/";)
>     l.simple_bind_s("cn=Manager,dc=local,dc=net", "secret")
>
> [...]
>
> When I now enter the url http://localhost:8000/ldapListUsers/ I get
> the following error:
>
> AttributeError at /ldapListUsers/
> 'WSGIRequest' object has no attribute 'initialize'
> Request Method:         GET
> Request URL:    http://localhost:8080/ldapListUsers/
> Exception Type:         AttributeError
> Exception Value:        'WSGIRequest' object has no attribute 'initialize'
> Exception Location:     /workspace/django_ldapAdmin/ldap/views.py in
> ldapListUsers, line 26
>
> [...]
>
> Please help me find the error ;)
>

You have a name clash between the ldap module you are importing at the top of
the module and the parameter to the view, both are named "ldap", you intend to
call functions from the ldap module but inside the view function the
ldap name is
the name of request. hence the error.

Regards,

-- 
 Ramiro Morales

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to