{
  "id": "python/django-auth-user-creation-error",
  "signature": "django.db.utils.IntegrityError: NOT NULL constraint failed: auth_user.username",
  "signature_zh": "完整性错误：auth_user.username 的非空约束失败",
  "regex": "django\\.db\\.utils\\.IntegrityError:\\ NOT\\ NULL\\ constraint\\ failed:\\ auth_user\\.username",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "创建用户时未提供用户名",
  "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": "设置 username 为 NULL",
      "why_fails": "数据库约束不允许 NULL",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "使用 email 作为用户名",
      "why_fails": "需要自定义用户模型",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "在创建用户时提供用户名",
      "success_rate": 1.0,
      "how": "User.objects.create_user(username='john', email='john@example.com', password='pass')",
      "condition": "",
      "sources": []
    },
    {
      "action": "使用 create() 方法并确保提供所有必填字段",
      "success_rate": 0.95,
      "how": "user = User(username='john', email='john@example.com'); user.set_password('pass'); user.save()",
      "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": "2025-07-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}