# werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'login'. Did you mean 'register' instead?

- **ID:** `python/flask-redirect-endpoint-not-found`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在 url_for() 或 redirect() 中使用了不存在的端点名称。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (100% success)
   ```
   @app.route('/login', endpoint='login')
def login_view():
    pass
# 然后在其他地方使用
redirect(url_for('login'))
   ```

## Dead Ends

- **** — 会破坏 Flask 的路由系统，且不灵活 (80% fail)
- **** — 会导致路由冲突，且不解决根本问题 (70% fail)
