How to resolve the Django-Postman CSRF Token error?

Kartikeya Rana
3 min readMay 11, 2021

This is a quick tutorial to resolve the CSRF error you receive in Postman while testing your Django application.

Step 1: Run the Django server and login into the admin page in the browser. Right-click anywhere on the webpage and click Inspect option.

Debug toolbox will open in your browser.

Step 2: Click on the network tab. It will start recording all the activities happening on the webpage.

Step 3: Reload the webpage. (Don’t close the inspect tab). Different entries will populate in the network tab. Click on admin entry.

Step 4: Go to the Headers tab. Scroll down and you will see Cookie inside Request Headers. Inside the cookie, you’ll find “csrftoken”. Copy/paste the token for future use.

--

--

Kartikeya Rana
Kartikeya Rana

Written by Kartikeya Rana

UCD Alumni | Aspiring Product Manager | Building Three Spoon on Google Play | An AI Developer and a heavy writer | https://www.linkedin.com/in/kartikeyarana10/

No responses yet