# django.urls.exceptions.NoReverseMatch: Reverse for 'product-detail' with arguments '('',)' not found. 1 pattern(s) tried: ['product/<int:pk>/']

- **ID:** `python/django-url-reverse-args-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Passing an empty string or non-integer as the primary key when using reverse() or {% url %} tag.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Check that pk is not None and is an integer: if pk: url = reverse('product-detail', args=[pk])
   ```
2. **** (90% success)
   ```
   Use get_object_or_404 to ensure object exists before reversing.
   ```

## Dead Ends

- **** — If pk is empty, it still fails; need to ensure pk is valid integer. (80% fail)
- **** — Hides the error and may lead to broken links. (70% fail)
