# jinja2.exceptions.UndefinedError: 'user' is undefined

- **ID:** `python/jinja2-undefined-user`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Template references a variable that was not passed to render_template or is missing from the context dict.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   return render_template('profile.html', user=current_user)
   ```
2. **** (85% success)
   ```
   app.jinja_env.undefined = jinja2.StrictUndefined
   ```

## Dead Ends

- **** — Silently renders empty output instead of surfacing the missing data. (80% fail)
- **** — Hides the real problem and breaks required logic. (70% fail)
