# werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'login'

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

## Root Cause

The endpoint name used in url_for or redirect does not match any defined route, or required parameters are missing.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Check the route decorator: @app.route('/login', endpoint='login') or ensure the function name matches.
   ```
2. **** (90% success)
   ```
   Provide required parameters: url_for('user_profile', username='john')
   ```

## Dead Ends

- **** — Using a hardcoded URL instead of url_for can break if routes change. (50% fail)
- **** — Adding a route with a different name does not fix the endpoint mismatch. (70% fail)
