# AssertionError: View function mapping is overwriting an existing endpoint function: main.index

- **ID:** `python/flask-blueprint-route-conflict`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Flask 蓝图中的路由端点名称冲突，两个路由使用了相同的端点名

## Version Compatibility

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

## Workarounds

1. **为每个路由指定唯一的端点名** (95% success)
   ```
   @blueprint.route('/index', endpoint='main_index')
def index():
    pass
   ```
2. **使用蓝图名称作为前缀** (90% success)
   ```
   blueprint = Blueprint('main', __name__, url_prefix='/main')
   ```

## Dead Ends

- **删除其中一个蓝图但保留路由** — 功能丢失，且根本问题未解决 (70% fail)
- **使用相同的函数名但不同蓝图** — 端点名仍然可能冲突 (80% fail)
