# HTTPException: 404 Not Found: /static/style.css

- **ID:** `python/starlette-static-file-not-found`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Starlette 静态文件目录配置错误或文件不存在

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.10 | active | — | — |
| 3.11 | active | — | — |

## Workarounds

1. **挂载静态文件目录** (95% success)
   ```
   from starlette.staticfiles import StaticFiles
app.mount('/static', StaticFiles(directory='static'), name='static')
   ```
2. **检查文件路径和权限** (90% success)
   ```
   ls -la static/style.css
chmod 644 static/style.css
   ```

## Dead Ends

- **将静态文件放在根目录并直接访问** — Starlette 不自动提供文件服务 (90% fail)
- **使用 Flask 的静态文件方式** — Starlette 配置语法不同 (80% fail)
