Make the implications of order in INSTALLED_APPS more consistent
|Reported by:||marfire||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||master|
|Cc:||k@…, marfire, mmitar@…, esauro, django@…||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
There are several subsystems that are affected by the order of the apps in INSTALLED_APPS. These include (at least): templates, static files, translations, and management commands. For the first three, the rule is that the first listed app has precedence: it will be used in preference to any app listed later that uses the same name for something (e.g. a template, file, or translation).
In the case of management commands, however, the semantics are just the opposite: precedence is given to apps that are listed later.
The proposal is to fix this so that management commands follow the same ordering rules as the other subsystems. This is an easy fix, but it has implications for backwards compatibility: specifically, for any project that currently has two apps in INSTALLED_APPS that define the same command, the one that is actually used will change. (Note that this does not apply to the case of apps overriding core management commands; they will continue to do so.)
See here for a discussion of the issue.
See #20914 for a proposal to document more thoroughly the issue of order in INSTALLED_APPS.
Change History (16)
comment:1 Changed 2 years ago by marfire
- Cc marfire added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from Make consistent the significance of app ordering in INSTALLED_APPS to Make the implications of order in INSTALLED_APPS more consistent
- Type changed from Bug to New feature
comment:2 Changed 2 years ago by russellm
- Resolution set to duplicate
- Status changed from new to closed
comment:6 Changed 2 years ago by mjtamlyn
- Component changed from Core (Other) to Core (Management commands)
- Resolution duplicate deleted
- Status changed from closed to new
- Triage Stage changed from Unreviewed to Accepted
- Type changed from New feature to Cleanup/optimization
- Version changed from 1.5 to master