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 we spot this issue in your GitHub pull request we give this advice:

settings.pymaintainabilitylow
MIDDLEWARE =[
    "django.contrib.sessions.middleware.SessionMiddleware",
    "django.middleware.common.CommonMiddleware",
    ...
]
-
USE_TZ = False
-
USE_I18N = True
-
USE_L10N = False
-
EMAIL_HOST = 'localhost'
-
EMAIL_PORT = 25

Stating defaults add complexity when reading the code but does not change Django's behaviour.

Read more
Protect your pull requests from over 40 types of common Django technical debts with our GitHub code review bot.

Configuring this check

Django Doctor will run this check by default. No configuration is needed but the check can be turned on/off using check code redundant-setting in your pyproject.toml file.

Read more about configuring Django Doctor.