[Django] #25356: startapp template mustn't encourage using default_app_config

10 views
Skip to first unread message

Django

unread,
Sep 5, 2015, 2:23:47 PM9/5/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: master
(Management commands) |
Severity: Release | Keywords:
blocker |
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I just noticed that `startapp` now generates an `apps.py`. This isn't
unreasonable. However it also sets `default_app_config` in `__init__.py`.
I have strong doubts about this.

`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.

Django

unread,
Sep 7, 2015, 9:21:28 AM9/7/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: timgraham
Type: Bug | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => assigned
* owner: nobody => timgraham
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:1>

Django

unread,
Sep 7, 2015, 9:40:19 AM9/7/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: timgraham
Type: Bug | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/5243 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:2>

Django

unread,
Sep 7, 2015, 3:27:40 PM9/7/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: timgraham
Type: Bug | Status: closed

Component: Core (Management | Version: master
commands) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Django

unread,
Sep 7, 2015, 3:33:07 PM9/7/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: timgraham
Type: Bug | Status: new

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* 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>

Django

unread,
Sep 7, 2015, 3:33:16 PM9/7/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* owner: timgraham => aaugustin


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:5>

Django

unread,
Sep 21, 2015, 4:51:40 PM9/21/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/5331

--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:6>

Django

unread,
Sep 21, 2015, 5:26:05 PM9/21/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:7>

Django

unread,
Sep 22, 2015, 2:32:42 AM9/22/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Sep 22, 2015, 2:34:51 AM9/22/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: assigned
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Sep 23, 2015, 11:04:13 AM9/23/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: closed

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: assigned => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/25356#comment:10>

Django

unread,
Nov 17, 2015, 7:43:18 PM11/17/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: closed
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Nov 17, 2015, 7:43:29 PM11/17/15
to django-...@googlegroups.com
#25356: startapp template mustn't encourage using default_app_config
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: Bug | Status: closed
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages