On Dec 3, 2009, at 3:29 PM, bfrederi wrote: > I'm not looking to avoid effort. I just don't want a bunch of extra > users cluttering up my system if I don't need to. I have no desire for > them to exist in my system for any reason. I want to keep the number > of django users limited in my system so it is easier to manage them in > admin. > > Thanks for the import advice though. Unfortunately, it's not what I'm > seeking. >
In which case, you'll need to rewrite an awful lot of contrib.auth to work with LDAP directly. The existing contrib.auth is designed to work with User models stored in a relational database, manipulated via the standard Django ORM. There are any number of working snippets for importing user data from LDAP or other sources on successful authentication, but they all work by creating a User and storing the model in the db. They just get their user info from AD, or wherever. The one you chose is very workable. While it sounds like a grand thing to avoid the redundancy of storing your users both in the db and in your original source, the amount of work involved makes it a non-starter for all but the most obsessed. And it really doesn't buy you much, practically speaking. I'd suggest to you that a better approach would be to work on customizing the admin to separate out your LDAP users from your local-to-Django users, I seem to recall seeing some snippets to that purpose. Basically, just rope off your LDAP users and ignore them. Though if you *do* wind up rewriting contrib.auth to work directly from LDAP, please do post, I'd love to see it. ---Peter P.S.: Thanks for the plug, Mike! :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.