How to resolve the Django-Postman CSRF Token error?
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.