Back slashes in TEMPLATES settings

DIRS must be forward slashes, even in Windows. Forward slashes do not need escaping, and they are cross Operating System compatible.

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

settings.pymaintainabilityhigh
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['\home\app\core\html'],
    },
]

DIRS must be forward slashes, even in Windows. Forward slashes do not need escaping, and they are cross Operating System compatible.

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 template-dir-backslash in your pyproject.toml file.

Read more about configuring Django Doctor.