{
  "id": "python/flask-template-not-found-error",
  "signature": "jinja2.exceptions.TemplateNotFound: index.html",
  "signature_zh": "模板未找到错误：index.html",
  "regex": "jinja2\\.exceptions\\.TemplateNotFound:\\ index\\.html",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Flask 在默认模板目录 'templates' 中找不到指定的模板文件",
  "root_cause_type": "generic",
  "root_cause_zh": "Flask 在默认模板目录 'templates' 中找不到指定的模板文件",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "将模板文件放在项目根目录而非 templates 文件夹",
      "why_fails": "Flask 默认只搜索 templates 文件夹",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "修改模板路径为绝对路径但忘记更新 render_template 调用",
      "why_fails": "路径不匹配或权限问题",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "创建 templates 文件夹并放置模板文件",
      "success_rate": 0.95,
      "how": "mkdir templates && mv index.html templates/",
      "condition": "",
      "sources": []
    },
    {
      "action": "在 Flask 应用中自定义模板目录",
      "success_rate": 0.9,
      "how": "app = Flask(__name__, template_folder='custom_templates')",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}