  
  from django import forms
  from django.core.exceptions import ImproperlyConfigured
  from django.core.paginator import Page
  from django.http.multipartparser import parse_header
  from django.template import Template, loader
  from django.test.client import encode_multipart
  from django.utils import six
 
</s> remove var csrftoken = getCookie('csrftoken');
 </s> add var csrftoken = getCookie(window.drf.csrfCookieName); </s> remove             'api_settings': api_settings
 </s> add             'api_settings': api_settings,
            'csrf_cookie_name': settings.CSRF_COOKIE_NAME,
from django.conf import settings
  
  from django import forms
from django.conf import settings
  from django.core.exceptions import ImproperlyConfigured
  from django.core.paginator import Page
  from django.http.multipartparser import parse_header
  from django.template import Template, loader
  from django.test.client import encode_multipart
  from django.utils import six
keep add keep 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/renderers.py