`default_app_config` is an ugly API that I included reluctantly for one
targeted use-case: allowing pre-existing pluggable apps to take advantage
of app config functionality in a backwards-compatible fashion, that is,
without requiring projets to upgrade their `INSTALLED_APPS` settings. The
first use of this feature was in `django.contrib.admin` in order to get
rid of `admin.autodiscover()` in `urls.py`.
Relying implicitly on a default app config if one exists is clearly a bad
practice. The good practice is to specifiy explicitly the full path to the
`AppConfig` class in `INSTALLED_APPS`.
I recommend to:
- remove this line from `app_template/__init__.py`
- promote explicit configuration of app configs in `INSTALLED_APPS`
- clarify the docs of `default_app_config` with the information I
described above
--
Ticket URL: <https://code.djangoproject.com/ticket/25356>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* owner: nobody => timgraham
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:1>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/5243 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:2>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"862de0b254bbb0ec75d637c7fbff258ecf232786" 862de0b]:
{{{
#!CommitTicketReference repository=""
revision="862de0b254bbb0ec75d637c7fbff258ecf232786"
Fixed #25356 -- Removed default_app_config from startapp template.
Also discouraged its use outside the intended use case.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:3>
* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* severity: Release blocker => Normal
Comment:
Thanks Tim. Assigning to myself as a reminder to restructure the text a
bit.
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:4>
* owner: timgraham => aaugustin
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:5>
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/5331
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:7>
Comment (by Aymeric Augustin <aymeric.augustin@…>):
In [changeset:"94a36cfd8c66a6be9a1e001b29e4c55071f4e0de" 94a36cfd]:
{{{
#!CommitTicketReference repository=""
revision="94a36cfd8c66a6be9a1e001b29e4c55071f4e0de"
Recommended against default_app_config.
Most likely this is a losing fight -- people seem to love this small
convention -- but at least the reasons for avoiding it will be
documented.
Refs #25356.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:8>
Comment (by Aymeric Augustin <aymeric.augustin@…>):
In [changeset:"76bf4bc1117524eb1305395451455b372e518c91" 76bf4bc]:
{{{
#!CommitTicketReference repository=""
revision="76bf4bc1117524eb1305395451455b372e518c91"
[1.8.x] Recommended against default_app_config.
Most likely this is a losing fight -- people seem to love this small
convention -- but at least the reasons for avoiding it will be
documented.
Refs #25356.
Backport of 94a36cf from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:9>
* status: assigned => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"6258e163352690faf20bfc92c12468316d1a47ae" 6258e163]:
{{{
#!CommitTicketReference repository=""
revision="6258e163352690faf20bfc92c12468316d1a47ae"
Refs #24971, #25356 -- Clarified how apps.py works in 1.9 release notes.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:11>
Comment (by Tim Graham <timograham@…>):
In [changeset:"7bbfc43e34c1909b8edfc8e3188c35447cffef15" 7bbfc43e]:
{{{
#!CommitTicketReference repository=""
revision="7bbfc43e34c1909b8edfc8e3188c35447cffef15"
[1.9.x] Refs #24971, #25356 -- Clarified how apps.py works in 1.9 release
notes.
Backport of 6258e163352690faf20bfc92c12468316d1a47ae from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:12>