{
  "id": "python/django-static-file-collection-error",
  "signature": "django.core.exceptions.ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the STATIC_ROOT directory.",
  "signature_zh": "配置错误：STATICFILES_DIRS 不应包含 STATIC_ROOT 目录",
  "regex": "django\\.core\\.exceptions\\.ImproperlyConfigured:\\ The\\ STATICFILES_DIRS\\ setting\\ should\\ not\\ contain\\ the\\ STATIC_ROOT\\ directory\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "STATICFILES_DIRS 中包含了 STATIC_ROOT 路径，导致循环",
  "root_cause_type": "generic",
  "root_cause_zh": "Django 静态文件收集时检测到目录冲突",
  "versions": [
    {
      "version": "3.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "删除 STATIC_ROOT 设置",
      "why_fails": "静态文件收集需要 STATIC_ROOT",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "将 STATICFILES_DIRS 设置为空列表",
      "why_fails": "可能丢失额外的静态文件目录",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "确保 STATICFILES_DIRS 不包含 STATIC_ROOT",
      "success_rate": 1.0,
      "how": "STATICFILES_DIRS = [BASE_DIR / 'static'] 且 STATIC_ROOT = BASE_DIR / 'staticfiles'",
      "condition": "",
      "sources": []
    },
    {
      "action": "使用不同的路径",
      "success_rate": 0.95,
      "how": "将静态文件放在 app 的 static 目录中，而不是 STATIC_ROOT",
      "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-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}