T
T
Trafalgar2022-03-25 00:33:09
Django
Trafalgar, 2022-03-25 00:33:09

When authorizing in the admin panel "Error checking CSRF. Request denied." what's wrong?

Hello, I'm new to Django and I'm facing a problem.
I deployed the project on the server, bound the domain, and when logging in to the admin panel, I get the error "CSRF validation failed. Request denied."

623ce3bc09970199086969.png
please tell me what is the reason for this and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philip Schultz, 2022-03-25
@manjarosan

In the project settings, you need to specify
CSRF_TRUSTED_ORIGINS=[" https://subdomain.example.com "] -> specify your address here accordingly)
This change appeared in django version 4+

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question