{
  "id": "python/django-suspiciousoperation",
  "signature": "django.core.exceptions.SuspiciousOperation: Invalid HTTP_HOST header",
  "signature_zh": "Django可疑操作：无效的HTTP_HOST头",
  "regex": "django\\.core\\.exceptions\\.SuspiciousOperation:\\ Invalid\\ HTTP_HOST\\ header",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The HTTP_HOST header in the request does not match ALLOWED_HOSTS setting.",
  "root_cause_type": "generic",
  "root_cause_zh": "请求中的HTTP_HOST头与ALLOWED_HOSTS设置不匹配。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting ALLOWED_HOSTS to ['*']",
      "why_fails": "Security risk; open to host header attacks.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignoring the error",
      "why_fails": "Request will be rejected.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add valid host to ALLOWED_HOSTS",
      "success_rate": 0.95,
      "how": "In settings.py: ALLOWED_HOSTS = ['example.com', 'www.example.com']",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use environment variable for dynamic hosts",
      "success_rate": 0.9,
      "how": "ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(',')",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}