Relative path in TEMPLATES setting

DIRS must be absolute paths. Relative paths will not work.

The TEMPLATE setting is a list of the template engines used when finding template files and rendering them.

The DIRS key within the TEMPLATE list denotes the directories where the engine should look for template source files.

If our GitHub code review bot spots this issue in your pull request it gives this advice:

django-doctorbotsuggested changes just now
settings.py
1
+
TEMPLATES = [
2
+
    {
3
+
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
4
+
        'DIRS': ['core/html'],
5
+
    },
6
+
]

DIRS must be absolute paths. Relative paths will not work.

Read more
Update settings.py
We're your Django code review copilot. Get code improvements right in your pull request with our GitHub code review bot.

Configuring this check

Code Review Doctor will run this check by default. No configuration is needed but the check can be turned on/off using check code template-dir-relative in your pyproject.toml file.

Read more about configuring Code Review Doctor.