Hello

Having spent my time developing with django's dev server, I was pretty
used to having all models (re)validated when the server reloaded.

However, when I connected the codebase to an apache/mod_python
instance, I had the surprise of seeing the miscellaneous models.py
INSTALLED_APPS didn't get loaded on startup - blatantly waiting for a
request to trigger their import.

That's very embarassing, because we use models.py as a place for
startup codes, and we like to have all models automatically loaded at
startup to quickly detect deployment errors (missing modules etc.).

>From all the threads browsed on the web, I got that actually only
urls.py or middlewares should be used for startup code - no mention is
done of models.py. But why then is everyone using models.py to connect
signals and other startup tasks ? It's a real fault, if that model
isn't required by a particular view, signals wont be setup, and the
workflow will be broken.

Why, then, isn't it specified that all models.py files should be
loaded by each starting worker ? That would solve the whole problem
and hidden errors around startup code like signals and startup checks.

Thanks for your attention, regards,
Pakal

-- 
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?hl=en.

Reply via email to