# django.template.exceptions.TemplateSyntaxError: 无效的块标签：'endblock'，期望'endblock'或'endblock name'

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

## 根因

块标签不匹配，通常是由于缺少{% block %}或多余的{% endblock %}。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Check template for correct block structure: {% block content %} ... {% endblock %}
   ```
2. **** (90% 成功率)
   ```
   Use {% block name %} and {% endblock name %} consistently.
   ```

## 无效尝试

- **** — Breaks template inheritance, losing content from parent templates. (90% 失败率)
- **** — May still be mismatched; need to ensure each block has a matching endblock. (60% 失败率)
