Performance: Template configuration and directories
MEDIUM IMPACT
This affects the server-side rendering speed and initial page load time by determining how templates are found and loaded.
TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],
'APP_DIRS': True,
'OPTIONS': {},
}]TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['/absolute/path/to/templates', '/another/absolute/path'],
'APP_DIRS': False,
'OPTIONS': {},
}]| Pattern | Filesystem Checks | Template Cache Usage | Server Response Impact | Verdict |
|---|---|---|---|---|
| Multiple absolute DIRS, APP_DIRS=False | High (multiple dirs checked) | No | Increases response time by 50-100ms | [X] Bad |
| Single relative DIRS, APP_DIRS=True | Low (cached app dirs) | Yes | Reduces response time by up to 70% | [OK] Good |