On Mon, 2008-07-14 at 23:30 -0700, django-m712 wrote:
[...]
> Has anyone else experienced this problem?

There are a few places in Django where we need to access all the models
in an app, for example. So we use __import__(), since that's the safest
way to do this. This is the same as calling reload() from the Python
interactive prompt if the module is already imported.

In this case, what you're seeing is probably
django.db.models.loading.get_apps() doing its thing, but there are other
places it can happen as well.

> Is there a way to fix this?

The premise there is that it's something that needs to be fixed. :-)

Modules can be imported multiple times. That's just a fact of life. It
can happen both through the use of __import__ and because of things like
an Apache process restarting and thus it needs to load modules (which
isn't the same as reloading into the same process space, but if you're
doing something which should only happen once externally, you need to
take measures).

For better or worse, your code needs to handle the possibility that
things (app packages, model modules, URL config files) could be imported
multiple times.

Regards,
Malcolm


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