{
  "id": "python/flask-url-for-external-required",
  "signature": "werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'index' with values ['_external']. Did you forget to specify values ['host']?",
  "signature_zh": "路由构建错误：无法为端点 'index' 构建包含 '_external' 的 URL。是否忘记指定值 ['host']？",
  "regex": "werkzeug\\.routing\\.exceptions\\.BuildError:\\ Could\\ not\\ build\\ url\\ for\\ endpoint\\ 'index'\\ with\\ values\\ \\['_external'\\]\\.\\ Did\\ you\\ forget\\ to\\ specify\\ values\\ \\['host'\\]\\?",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Flask 的 url_for 函数在生成外部 URL 时缺少 host 参数",
  "root_cause_type": "generic",
  "root_cause_zh": "Flask 的 url_for 函数在生成外部 URL 时缺少 host 参数",
  "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": "移除 _external 参数",
      "why_fails": "生成的 URL 可能不完整",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "硬编码主机名",
      "why_fails": "不灵活，不同环境需要修改",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "在应用配置中设置 SERVER_NAME",
      "success_rate": 0.95,
      "how": "app.config['SERVER_NAME'] = 'example.com'",
      "condition": "",
      "sources": []
    },
    {
      "action": "显式传递 host 参数",
      "success_rate": 0.9,
      "how": "url_for('index', _external=True, host='example.com')",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-08-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}