Hi Stodge,

On 01/05/2016 08:57 AM, Stodge wrote:
> I'm using Django 1.6.9. When the dev server (and hence Apache) starts,
> is Django supposed to import models for apps that exist on disk, but
> aren't enabled in the settings? I'm seeing this behaviour and I wasn't
> expecting it. Thanks

Django shouldn't do that on its own. AFAIK the only reason a models file
should be imported is a) because it's listed in INSTALLED_APPS, or b)
because something else that is imported imports it (possibly also c) an
installed model has an FK linking to it with a string reference?).

My first guess would be that you're seeing case (b). If you just add an
"assert False" at module-level in the models file in question, the
resulting traceback should show you the import chain leading to its import.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/568BE8AE.4040507%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to