# django.db.utils.IntegrityError: UNIQUE constraint failed: auth_user.username

- **ID:** `python/django-user-creation-race`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Two concurrent requests attempt to create a user with the same username.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Use transaction.atomic() and select_for_update to lock the row before checking existence.
   ```

## Dead Ends

- **** — User isn't created, but no feedback given; data loss. (60% fail)
- **** — Still can raise IntegrityError under concurrency. (80% fail)
