The same code from the repo works fine out in the wild. But on my local environment, I'm getting CSRF errors on form submits.
Django 1.11.13, Python 2.7
It's very hard to debug, because there's not really any breakpoint. the error occurs way before the view.
The CSRF token is in the form {% csrf_token %}
, the hidden field is there, the cookie is there.
I've tried creating a new virtual environment, wiping the database, different browsers. What else?
Well, I feel stupid. This must've occurred when we upgraded all our Django apps to v1.11 or v2.0. Somehow I got a SESSION_COOKIE_DOMAIN key in my local settings that reflected the domain of our staging environment. Live and learn.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With