# django.http.response.HttpResponseNotAllowed: Method Not Allowed (GET): /api/data/

- **ID:** `python/django-request-method-not-allowed`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

View does not handle the HTTP method (e.g., only POST allowed but GET requested).

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Implement method check: if request.method == 'GET': ... elif request.method == 'POST': ...
   ```
2. **** (95% success)
   ```
   Use @require_http_methods(['GET', 'POST']) decorator.
   ```

## Dead Ends

- **** — Adding @require_POST to an endpoint that needs both GET and POST will block GET requests. (70% fail)
- **** — Changing the URL pattern without updating the view's method decorators doesn't help. (40% fail)
