[PYTHON] CSRF validation error when accessing django 3.0 admin page in Chrome

Overview

When I log in to django's admin page using Chrome, the screen doesn't transition for a while after completing the form, and the following error message is displayed. access_error.jpg With Microsoft Edge, such an error does not occur. Apparently, it's not the django side, but the Chrome cookie settings.

Operating environment

django=3.0

solution

--Check the csrf token --Chrome developer tools [Ctrl + Shift + i] ⇒ Application ⇒ Check if csrf token exists in Cookies in Storage --Try clearing Chrome cookies --Chrome ⇒ Settings ⇒ Advanced settings ⇒ Privacy and security ⇒ Delete cookies from browsing history data deletion ――If that doesn't work --Privacy and security ⇒ Cookies and site data --Turn on Allowing Sites to Save and Read Cookie Data --Turn on to delete cookies and site data when Chrome is closed

Reference site

https://qiita.com/UNKCHAN/items/371bf04bbeea1c5e9904 https://stackoverflow.com/questions/29573163/django-admin-login-suddenly-demanding-csrf-token

Recommended Posts

CSRF validation error when accessing django 3.0 admin page in Chrome
When accessing from Andorid Chrome, Django CSRF validation fails or you can't log in
[Django] Error when SlugField is specified in .filter ()
Display error message when login fails in Django
I can't log in to the admin page with Django3
When you forget your admin screen username / password in Django
[Django] sqlite version error when running python manage.py in aws cloud9 environment
When you can't call base.html in Django
[Django] Want to customize your admin page?
[Django] Error encountered when deploying heroku Part 2
Permission error when reading Django upload files
[python] What to do when an error occurs in send_keys of headless chrome
[Python] What to check when you get a Unicode Decode Error in Django