1, the request Tests
Adding the following code:
var csrf_token = postman.getResponseCookie("csrftoken").value
postman.clearGlobalVariable("csrftoken");
postman.setGlobalVariable("csrftoken", csrf_token);
pm.environment.get("variable_key");
Figure:
2, the request header is added:
X-CSRFToken: {{csrftoken}}
Figure: