#28488: Django 1.11+ raises CSRF verification failed if settings.DEBUG is False and an intermediate 404 page is requested -------------------------------------+------------------------------------- Reporter: Ruben Alves | Owner: nobody Type: Bug | Status: new Component: CSRF | Version: master Severity: Release blocker | Resolution: Keywords: csrf failed | Triage Stage: Accepted settings debug false production | Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Berker Peksag): I just tried Nicola's sample project and I was able to reproduce it locally. For some strange reason, I can't reproduce it locally on my own project even if I made the same request: {{{ [19/Sep/2017 02:00:34] "GET / HTTP/1.1" 200 42428 [19/Sep/2017 02:00:36] "GET /static/js/main-min.js HTTP/1.1" 404 31942 [19/Sep/2017 02:00:50] "GET /admin/login/?next=/admin/ HTTP/1.1" 200 1625 [19/Sep/2017 02:00:50] "GET /static/admin/css/base.css HTTP/1.1" 404 31950 [19/Sep/2017 02:00:50] "GET /static/admin/css/login.css HTTP/1.1" 404 31952 }}} I removed all custom middlewares and copied the `MIDDLEWARE` setting from Nicola's project and I was still able to login successfully. On both local and production environment, I see different `csrfmiddlewaretoken` values after each refresh but the value of `csrfmiddlewaretoken` doesn't match with the `csrftoken` cookie (it also stays same after I refreshed the page) However, the `csrftoken` cookie changes each request in Nicola's project. -- Ticket URL: <https://code.djangoproject.com/ticket/28488#comment:37> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.9be3045110ae74e783f24abc816a071e%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.