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.
DIRS must be forward slashes, even in Windows. Forward slashes do not need escaping, and they are cross Operating System compatible.
So in practice, do this
TEMPLATES = [
{
# …
'DIRS': ['/path/to/project/templates'],
}
}
Instead of this
TEMPLATES = [
{
# …
'DIRS': [r'path oproject emplates'],
}
}
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.