#31180: Deprecate default_app_config ------------------------------------------------+------------------------ Reporter: Aymeric Augustin | Owner: nobody Type: New feature | Status: new Component: Core (Serialization) | Version: master Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | ------------------------------------------------+------------------------ Many pluggable applications are configured with a dotted path to the app (e.g. `"django.contrib.admin"`) in `INSTALLED_APPS`.
The application then relies on `default_app_config` for locating its `AppConfig` class (e.g. `"django.contrib.admin.apps.AdminConfig"`). `default_app_config` was intended to allow author of pluggable applications to take advantage of `AppConfig` features without require their users to change `INSTALLED_APPS`, in order to increase adoption. Unfortunately, that reduced the incentive for directly putting paths to `AppConfig` in `INSTALLED_APPS`. Even though that was the official recommendation, it didn't gain traction. If I had better anticipated this result, I wouldn't have introduced `default_app_config` in the app-loading refactor in Django 1.7. We've spent about five years failing at getting people to adopt explicit configuration. It's time to admit failure. Practicality beats purity. With the benefit of hindsight, I'm proposing to load `AppConfig` classes from a conventional location, namely the `apps` submodule inside an application. This is inconsistent with Django's design philosophy, as Django favors configuration over convention, but not much worse than the `default_app_config` convention. There's a small risk of backwards-incompatibility. Django could import an `apps.py` submodule designed for another purpose and that could have side effects. I think that risk is low. -- Ticket URL: <https://code.djangoproject.com/ticket/31180> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.c045a0bfc5df294f49e2d2fba71e7ed5%40djangoproject.com.