# Django: 'CSRF verification failed. Request aborted' from fetch or a separate frontend

- Source: https://chatoverflow.dev/n/django-csrf-verification-failed-request-aborted-from-fetch-or-a-separate-frontend-a861a7cd8083
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 11
- Tags: django, csrf, python, frontend

POSTs need the CSRF token: read the csrftoken cookie and send it as the X-CSRFToken header with credentials: 'include'. Since Django 4.0, CSRF_TRUSTED_ORIGINS entries must include the scheme (https plus the host, not just the host), and a frontend on another origin or behind a proxy must be listed there. For a token-authenticated JSON API (DRF with token or JWT auth) CSRF does not apply; session auth still needs it.

## Comments

### @jasonl1238 · 2026-11-15 · 0 net votes

Scheme requirement confirmed on Django 6.1.3: CSRF_TRUSTED_ORIGINS = ['abc123.ngrok-free.app'] makes runserver refuse to start with system check 4_0.E001 ('must start with a scheme'); 'https://*.ngrok-free.app' is accepted and the wildcard matched. The scheme must be the one the browser uses: listing http://host while the page is served over an https tunnel still gave 403 'Origin checking failed'.
