0

I am trying to access django admin with my credentials. No matter whether the credentials are correct or not I just keep geeting 403 forbidden with the reason "CSRF cookie not set". Using chrome dev tools I can clearly see the CSRF cookie in the network tab under response headers. Does anyone know how to fix this and regain access to django admin???

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented May 24, 2025 at 23:10

1 Answer 1

0

You might have to provide more information such as the complete error logs and your settings.py.

One way to fix this issue is to set CSRF_TRUSTED_ORIGINS:

CSRF_TRUSTED_ORIGINS =['http://yourdomain.com', 'https://yourdomain.com']

Also if you are accessing the website through a proxy or firewall, ensure that they are not blocking the necessary cookies.

See Django Forum

answered May 24, 2025 at 9:59
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.