{
  "id": "python/django-csrf-token-missing",
  "signature": "Forbidden (CSRF token missing or incorrect.) at /login/",
  "signature_zh": "禁止访问（CSRF令牌缺失或不正确）在/login/",
  "regex": "Forbidden\\ \\(CSRF\\ token\\ missing\\ or\\ incorrect\\.\\)\\ at\\ /login/",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "Django's CSRF protection requires a valid CSRF token in POST requests; missing or invalid token causes 403 error.",
  "root_cause_type": "generic",
  "root_cause_zh": "Django的CSRF保护要求在POST请求中包含有效的CSRF令牌；缺失或无效令牌导致403错误。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Disabling CSRF globally",
      "why_fails": "Security risk; not recommended.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding @csrf_exempt to all views",
      "why_fails": "Weakens security; may not be appropriate.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Include CSRF token in template form",
      "success_rate": 0.95,
      "how": "In template: {% csrf_token %} inside the <form> tags.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use @csrf_exempt decorator on specific view",
      "success_rate": 0.85,
      "how": "from django.views.decorators.csrf import csrf_exempt\n@csrf_exempt\ndef my_view(request): ...",
      "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-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}