# django.template.exceptions.TemplateDoesNotExist: admin/login.html

- **ID:** `python/django-template-loader-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Django 在模板目录中找不到指定的模板文件

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.2 | active | — | — |
| 4.0 | active | — | — |
| 5.0 | active | — | — |

## Workarounds

1. **检查模板路径是否正确** (95% success)
   ```
   确保模板文件位于 app/templates/admin/login.html 或 DIRS 指定的目录
   ```
2. **在 settings.py 中配置模板目录** (90% success)
   ```
   TEMPLATES[0]['DIRS'] = [BASE_DIR / 'templates']
   ```

## Dead Ends

- **在模板目录中创建空文件** — 空文件会导致渲染错误 (90% fail)
- **修改 TEMPLATES 设置中的 DIRS 为错误路径** — 路径错误仍然找不到模板 (80% fail)
