# django.core.exceptions.ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the STATIC_ROOT directory.

- **ID:** `python/django-static-file-collection-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

STATICFILES_DIRS 中包含了 STATIC_ROOT 路径，导致循环

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.2 | active | — | — |
| 4.0 | active | — | — |
| 5.0 | active | — | — |

## Workarounds

1. **确保 STATICFILES_DIRS 不包含 STATIC_ROOT** (100% success)
   ```
   STATICFILES_DIRS = [BASE_DIR / 'static'] 且 STATIC_ROOT = BASE_DIR / 'staticfiles'
   ```
2. **使用不同的路径** (95% success)
   ```
   将静态文件放在 app 的 static 目录中，而不是 STATIC_ROOT
   ```

## Dead Ends

- **删除 STATIC_ROOT 设置** — 静态文件收集需要 STATIC_ROOT (80% fail)
- **将 STATICFILES_DIRS 设置为空列表** — 可能丢失额外的静态文件目录 (60% fail)
