I have an
AppConfig.ready() implementation which depends on the readiness of an other application.
Is there a signal or method (which I could implement) which gets called after all application
ready() methods have been called?
I know that django processes the signals in the order of
But I don’t want to enforce a particular ordering of
INSTALLED_APPS=[ 'app_a', 'app_b', ... ]
How can “app_a” receive a signal (or method call) after “app_b” processed
INSTALLED_APPS is not a solution)
I’m afraid the answer is No. Populating the application registry happens in
django.setup(). If you look at the source code, you will see that neither
django.setup() dispatch any signals upon completion.
Here are some ideas:
You could dispatch a custom signal yourself, but that would require that you do that in all entry points of your Django project, e.g.
wsgi.pyand any scripts that use
You could connect to
request_startedand disconnect when your handler is called.
If you are initializing some kind of property, you could defer that initialization until the first access.
If any of these approaches work for you obviously depends on what exactly you are trying to achieve.
Answered By – Daniel Hepper