How do I fix 'CSRF verification failed' when submitting a form in Django behind a proxy?
0votes
Context
Django 5 app deployed behind a reverse proxy (Cloudflare in front of Render). The site is served over HTTPS at a custom domain. Login and contact forms include {% csrf_token %} and work perfectly on localhost.
Expected
Submitting any form on the production site should process normally.
What Happened
Every POST on production returns 403 Forbidden — CSRF verification failed. Origin checking failed even though the CSRF token is present in the form.
No comments yet.