Debugging django admin 403 Forbidden error

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???

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

Вернуться на верх