LoginSignup
0
0

More than 1 year has passed since last update.

Django+uwsgi+NginxでCSRF verificatrion failedが出た

Last updated at Posted at 2022-03-28

Djangoで作ったwebアプリをNginxとuwsgi使って動かそうとしたら、フォームの送信のところで Forbidden(403) CSRF verification failed のエラーが出た。

Nginxとかの設定は https://office54.net/python/django/ubuntu-django-nginx-uwsgi を参考にした。

ブラウザの F12→コンソール でエラーが出る前後を確認していたら、

"secure" Cookie がすでに存在しているため、Cookie "csrftoken" は拒否されています。

と出ていたので、ブラウザのCookieを削除したら問題なくフォームが送信できるようになった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0