No proper initialization of models/signals/etc....
|Reported by:||Pakal||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
As discussed in http://groups.google.com/group/django-developers/browse_thread/thread/825c154c54f79ad9 ,
there is a real problem with the fact that, in production mode (mod_python, mod_wsgi...), no loading of installed applications occurs, contrarily to what we have in django's dev server.
This raises major issues, imo :
- silent errors in the signaling framework : if a module isn't explicitely loaded by a view during request processing, the signal connections it contains will never be performed, so it makes the whole signaling framework quite broken.
- no proper place to put startup code : a quick google search shows that people are multiplying awkward constructs to initialize their application, by putting code in settings.py (which is often loaded several times => problems), in urls.py (that's NOT the point of this module), in temporary ("one-shot") middlewares...
Wouldn't it be quite handier to give each application a chance to initialize at server (or rather, worker process) startup, by loading all models.py, or maybe better, all init.py from INSTALLED_APPS ?
Change History (4)
comment:2 Changed 5 years ago by
|Status:||closed → reopened|