Hello,

since version 1.2, there has been no changes about this issue, which still 
bothers me:
https://code.djangoproject.com/ticket/14916

In summary, the django dev server loads models.py of every INSTALLED_APP, 
and thus (somehow) ensures proper initialization of models and signals. 

But in production, web servers do NOT load more than the strict minimum 
required by the requests they serve, so it opens the door to very subtle 
and deadly bugs, where the first requests of every new django process might 
miss a good part of the whole workflow, because miscellaneous "hooks" have 
not been registered properly.
Doesn't this advocate a global import of all installed_apps' models.py, at 
process setup ?

And more generally, people have no idea where to put their django setup 
code, so there are tons of forum threads and workarounds about this, using 
mod_wsgi's start script, or code in urls.py/settings.py, or even dedicated 
on-shot middelwares (
http://www.allbuttonspressed.com/projects/django-autoload).
Wouldn't it be worth offering a place, in a project and/or in each django 
app, which will be called AFTER all models/signals are initialized, but 
BEFORE the first request is served ? Same behaviour as the "fake 
middleware" trick, but without its ugliness.

thanks in advance,
regards,
Pascal

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to