          """
          if data is None:
              return ''
  
          # If the media type looks like 'application/json; indent=4', then
          # pretty print the result.
          indent = get_media_type_params(accepted_media_type).get('indent', None)
          sort_keys = False
          try:
              indent = max(min(int(indent), 8), 0)
              sort_keys = True
          except (ValueError, TypeError):
              indent = None
  
          return json.dumps(data, cls=self.encoder_class,
                            indent=indent, sort_keys=sort_keys)
  
  
 
</s> remove         # If either of these reserved parameters are turned off then content tunneling is not possible
        if self.view.request._CONTENTTYPE_PARAM is None or self.view.request._CONTENT_PARAM is None:
            return None

        # Okey doke, let's do it
        return GenericContentForm(view, view.request)
 </s> add         return GenericContentForm() </s> remove     def render(self, data=None, accepted_media_type=None):
 </s> add     def render(self, data, accepted_media_type=None, renderer_context=None): </s> remove     def render(self, data=None, accepted_media_type=None):
 </s> add     def render(self, data, accepted_media_type=None, renderer_context=None): </s> remove     def render(self, data=None, accepted_media_type=None):
 </s> add     def render(self, data, accepted_media_type=None, renderer_context=None): </s> remove         renderer = self.accepted_renderer
        media_type = self.accepted_media_type
 </s> add         renderer = getattr(self, 'accepted_renderer', None)
        media_type = getattr(self, 'accepted_media_type', None)
        context = getattr(self, 'renderer_context', None)
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
          """
          if data is None:
              return ''
  
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
        # If 'indent' is provided in the context, then pretty print the result.
        # E.g. If we're being called by the BrowseableAPIRenderer.
        renderer_context = renderer_context or {}
        indent = renderer_context.get('indent', None)
        sort_keys = indent and True or False

        if accepted_media_type:
            # If the media type looks like 'application/json; indent=4',
            # then pretty print the result.
            params = get_media_type_params(accepted_media_type)
            indent = params.get('indent', indent)
            try:
                indent = max(min(int(indent), 8), 0)
                sort_keys = True
            except (ValueError, TypeError):
                indent = None
  
          return json.dumps(data, cls=self.encoder_class,
                            indent=indent, sort_keys=sort_keys)
  
  
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Make sure JSON output in Browseable API is nicely indented 
rest_framework/renderers.py