On Mon, 2006-07-10 at 14:40 +0200, Michael Radziej wrote:
> Hi,
> 
> Looking into django.contrib.auth.__init__, it seems that
> load_backend() is called for each request when you need to access
> the request.user object. Then, the backend module is imported via
>  __import__. Isn't that a little much of an overhead?

The __import__() call does not reimport the module if it already exists
in sys.modules. It works just like the "import" statement in Python (and
reload() works like imp.load_module()). So, aside from a single
dictionary lookup, there is no overhead to calling it multiple times.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to