# 模板不存在错误：base.html

- **ID:** `python/django-template-inheritance-error`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

基础模板文件缺失或不在模板目录中。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Ensure base.html exists in templates directory and set TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [BASE_DIR/'templates']}]
   ```
2. **** (90% 成功率)
   ```
   Use {% extends 'app/base.html' %} and ensure app/templates/app/base.html exists.
   ```

## 无效尝试

- **** — Setting TEMPLATE_DIRS incorrectly doesn't find the template. (60% 失败率)
- **** — Using absolute path without adding to DIRS still fails. (40% 失败率)
