On 02/11/2014 12:11 PM, Val Neekman wrote: > Is the following statement still valid? > > "Any handlers that listen to this signal need to be *written* in a > particular place: a management module in one of your INSTALLED_APPS > <https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-INSTALLED_APPS>. > If handlers are *registered* anywhere else they may not be loaded > by migrate > <https://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-migrate>." > > 1. I scanned the source and did not find the code imposing the above > statement. > 2. Handlers that are not in the management directory are still called. > > Unless the statement means something different or the supporting code > has been removed.
I would assume that this is not an explicitly-imposed restriction, it's just a natural consequence of the fact that modules in your codebase that are imported by a normal request-handling server process may never be imported when you run manage.py migrate, whereas you can be assured that that the "management" module will be imported (because that's where Django searches for management commands in the first place). I would also guess (although this should be verified) that this warning could be updated to include models.py modules as a safe place to register these handlers; it may be that this documentation was written before the app-loading updates, but post-app-loading it should be guaranteed that by the time a management command runs all models of all installed apps are imported. Carl -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/52FA7742.9040804%40oddbird.net. For more options, visit https://groups.google.com/groups/opt_out.
