Stating defaults add complexity when reading the code but does not change Django's behaviour.
Django defines a set of default values that can be overridden in the settings file.
Explicitly overriding the default values with the same value as the default value is redundant.
Redundant settings increase noise when developers are reading the settings file, making the code harder to maintain.
If our GitHub code review bot spots this issue in your pull request it gives this advice:
1 | + | MIDDLEWARE =[ | |
2 | + | "django.contrib.sessions.middleware.SessionMiddleware", | |
3 | + | "django.middleware.common.CommonMiddleware", | |
4 | + | ... | |
5 | + | ] | |
6 | + | USE_TZ = False |
Stating defaults add complexity when reading the code but does not change Django's behaviour.
Read more- | USE_TZ = False |