Fix app config base class being silently ignored - #852
Merged
Conversation
App configs from `manage.py startapp` have never been applied. The generated subclass imports the base — Django finds two AppConfigs in `apps.py`, neither marked default, and quietly falls back to a plain one. `default = False` on the base and `default = True` in the template fix it.
nkiryanov
force-pushed
the
fix/app-config-silently-ignored
branch
2 times, most recently
from
July 25, 2026 15:18
876dcc8 to
665bff7
Compare
nkiryanov
commented
Jul 25, 2026
|
|
||
| # Django's `apps.py` scan sees two configs — yours and this one, pulled in by your import. | ||
| # `False` here, `True` in your subclass: otherwise Django silently takes a plain AppConfig. | ||
| default = False |
Contributor
Author
There was a problem hiding this comment.
вот это default нужен чтоб брался правильно сконфигурированный класс из my_app/app.py
Иначе при регистрации приложения в installed_app попадал класс AppConfig — в своё время несколько часов пришлось дебажить почему переводы приложений в админку не доходят.
Contributor
Author
|
@kazqvaizer, @f213 может вообще удалим переопределенный |
nkiryanov
commented
Jul 25, 2026
| SRC_DIR / ".locale", | ||
| ] | ||
|
|
||
| USE_i18N = True |
Contributor
Author
There was a problem hiding this comment.
это:
- не нужно, т.к. теперь True всегда по дефолту
- никогда не работало, т.к. ключ с ошибкой (должен быть USE_I18N
i→I)
Contributor
Не думаю, это выглядит скорее как манифест - если удалим, то наши же LLM могут нахулиганить нам сигналов. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
App configs from
manage.py startapphave never been applied.The generated subclass imports the base — Django finds two AppConfigs in
apps.py, neither marked default, and quietly falls back to a plain one.default = Falseon the base anddefault = Truein the template fix it.