Since Django 1.7 the AppConfig
feature has been added suggesting that post_migrate signals should be put in the ready()
part of its customized implementation - https://docs.djangoproject.com/en/stable/ref/signals/#post-migrate
The basic way to implement AppConfig
described by the docs is to point to it in the __init__.py
file using default_app_config
setting. The docs would also suggest a way to override an existing AppConfig
for any app:
https://docs.djangoproject.com/en/stable/ref/applications/#for-application-users
I have researched a bit and found out that django actually creates AppConfig
instance for every app in INSTALLED_APPS
even if its custom implementation is not implemented it would bootstrap the default for you.
My question is how one should provide a customized app configuration with post_migrate
signal for an app that doesn't implement AppConfig
(the easiest example would be a third party package without apps.py)?
I know that even for this app the django would go and create a default version of AppConfig
but where and how should i tell it NOT to do so and use my custom AppConfig
instead with overrided ready()
method implementation to add post_migrate
?