          // or any other URL that isn't scheme relative or absolute i.e relative.
          !(/^(\/\/|http:|https:).*/.test(url));
  }
  
  var csrftoken = getCookie('csrftoken');
  
  $.ajaxSetup({
      beforeSend: function(xhr, settings) {
          if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
              // Send the token to same-origin, relative URLs only.
 
</s> remove             'api_settings': api_settings
 </s> add             'api_settings': api_settings,
            'csrf_cookie_name': settings.CSRF_COOKIE_NAME,
var csrftoken = getCookie(window.drf.csrfCookieName);
          // or any other URL that isn't scheme relative or absolute i.e relative.
          !(/^(\/\/|http:|https:).*/.test(url));
  }
  
var csrftoken = getCookie(window.drf.csrfCookieName);
  
  $.ajaxSetup({
      beforeSend: function(xhr, settings) {
          if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
              // Send the token to same-origin, relative URLs only.
keep keep keep keep replace keep keep keep keep keep
 Added support for custom CSRF cookie names

Instead of hardcoding the CSRF cookie name, the value is passed to the template as a context variable, rendered as a JavaScript variable, and read by csrf.js.

Fixes #4048 
rest_framework/static/rest_framework/js/csrf.js