# django.contrib.auth.models.User.DoesNotExist: User matching query does not exist.

- **ID:** `python/django-auth-user-not-found`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

尝试获取不存在的用户对象

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   from django.shortcuts import get_object_or_404; user = get_object_or_404(User, pk=user_id)
   ```
2. **** (90% success)
   ```
   if request.user.is_authenticated: ...
   ```

## Dead Ends

- **** — 程序可能继续运行但用户对象为None，导致后续错误 (60% fail)
- **** — 可能掩盖了真实问题，用户不存在但无提示 (50% fail)
