  
      Should be a tuple/list of classes as described in the :mod:`renderers` module.
      """
  
      # TODO: wrap this behavior around dispatch(), ensuring it works
      # out of the box with existing Django classes that use render_to_response.
      def render(self, response):
          """
          Takes a :obj:`Response` object and returns an :obj:`HttpResponse`.
          """
          self.response = response
  
          try:
              renderer, media_type = self._determine_renderer(self.request)
          except ErrorResponse, exc:
 
</s> remove         self.raw_content = content      # content prior to filtering
        self.cleaned_content = content  # content after filtering
        self.headers = headers or {}
 </s> add         self.request = request
        if renderers is not None:
            self.renderers = renderers
        # TODO: must go
        self.view = None

    # TODO: wrap this behavior around dispatch(), ensuring it works
    # out of the box with existing Django classes that use render_to_response.
    @property
    def rendered_content(self):
        """
        """
        renderer, media_type = self._determine_renderer()
        # TODO: renderer *could* override media_type in .render() if required.

        # Set the media type of the response
        self['Content-Type'] = renderer.media_type

        # Render the response content
        if self.has_content_body:
            return renderer.render(self.raw_content, media_type)
        return renderer.render() </s> remove     _ACCEPT_QUERY_PARAM = '_accept'        # Allow override of Accept header in URL query params
    _IGNORE_IE_ACCEPT_HEADER = True

 </s> add  </s> remove 
        try:
            renderer, media_type = self._determine_renderer(self.request)
        except ErrorResponse, exc:
            renderer = self._default_renderer(self)
            media_type = renderer.media_type
            response = exc.response

        # Set the media type of the response
        # Note that the renderer *could* override it in .render() if required.
        response.media_type = renderer.media_type

        # Serialize the response content
        if response.has_content_body:
            content = renderer.render(response.cleaned_content, media_type)
        else:
            content = renderer.render()

        # Build the HTTP Response
        resp = HttpResponse(content, mimetype=response.media_type, status=response.status)
        for (key, val) in response.headers.items():
            resp[key] = val

        return resp

    def _determine_renderer(self, request):
        """
        Determines the appropriate renderer for the output, given the client's 'Accept' header,
        and the :attr:`renderers` set on this class.

        Returns a 2-tuple of `(renderer, media_type)`

        See: RFC 2616, Section 14 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
        """

        if self._ACCEPT_QUERY_PARAM and request.GET.get(self._ACCEPT_QUERY_PARAM, None):
            # Use _accept parameter override
            accept_list = [request.GET.get(self._ACCEPT_QUERY_PARAM)]
        elif (self._IGNORE_IE_ACCEPT_HEADER and
              'HTTP_USER_AGENT' in request.META and
              MSIE_USER_AGENT_REGEX.match(request.META['HTTP_USER_AGENT'])):
            # Ignore MSIE's broken accept behavior and do something sensible instead
            accept_list = ['text/html', '*/*']
        elif 'HTTP_ACCEPT' in request.META:
            # Use standard HTTP Accept negotiation
            accept_list = [token.strip() for token in request.META['HTTP_ACCEPT'].split(',')]
        else:
            # No accept header specified
            accept_list = ['*/*']

        # Check the acceptable media types against each renderer,
        # attempting more specific media types first
        # NB. The inner loop here isn't as bad as it first looks :)
        #     Worst case is we're looping over len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for accepted_media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for accepted_media_type in accepted_media_type_lst:
                    if renderer.can_handle_response(accepted_media_type):
                        return renderer, accepted_media_type

        # No acceptable renderers were found
        raise ErrorResponse(status.HTTP_406_NOT_ACCEPTABLE,
                                {'detail': 'Could not satisfy the client\'s Accept header',
                                 'available_types': self._rendered_media_types})
 </s> add         return response </s> remove     def __init__(self, status=200, content=None, headers=None):
        self.status = status
        self.media_type = None
 </s> add     _ACCEPT_QUERY_PARAM = '_accept'        # Allow override of Accept header in URL query params
    _IGNORE_IE_ACCEPT_HEADER = True

    def __init__(self, content=None, status=None, request=None, renderers=None):
        """
        content is the raw content.

        The set of renderers that the response can handle.

        Should be a tuple/list of classes as described in the :mod:`renderers` module.
        """
        # First argument taken by `SimpleTemplateResponse.__init__` is template_name,
        # which we don't need
        super(Response, self).__init__(None, status=status)
        # We need to store our content in raw content to avoid overriding HttpResponse's
        # `content` property
        self.raw_content = content  </s> remove             response_obj = handler(request, *args, **kwargs)

            # Allow return value to be either HttpResponse, Response, or an object, or None
            if isinstance(response_obj, HttpResponse):
                return response_obj
            elif isinstance(response_obj, Response):
                response = response_obj
            elif response_obj is not None:
                response = Response(status.HTTP_200_OK, response_obj)
            else:
                response = Response(status.HTTP_204_NO_CONTENT)
 </s> add             # TODO: should we enforce HttpResponse, like Django does ?
            response = handler(request, *args, **kwargs)

            # Prepare response for the response cycle.
            self.prepare_response(response)
    response_class = Response

    def prepare_response(self, response):
        """
        Prepares response for the response cycle. Sets some headers, sets renderers, ...
        """
        if hasattr(response, 'request') and response.request is None:
            response.request = self.request
        # Always add these headers.
        response['Allow'] = ', '.join(allowed_methods(self))
        # sample to allow caching using Vary http header
        response['Vary'] = 'Authenticate, Accept'
        # merge with headers possibly set at some point in the view
        for name, value in self.headers.items():
            response[name] = value
        # set the views renderers on the response
        response.renderers = self.renderers
        # TODO: must disappear
        response.view = self
  
      Should be a tuple/list of classes as described in the :mod:`renderers` module.
      """
  
    response_class = Response

    def prepare_response(self, response):
        """
        Prepares response for the response cycle. Sets some headers, sets renderers, ...
        """
        if hasattr(response, 'request') and response.request is None:
            response.request = self.request
        # Always add these headers.
        response['Allow'] = ', '.join(allowed_methods(self))
        # sample to allow caching using Vary http header
        response['Vary'] = 'Authenticate, Accept'
        # merge with headers possibly set at some point in the view
        for name, value in self.headers.items():
            response[name] = value
        # set the views renderers on the response
        response.renderers = self.renderers
        # TODO: must disappear
        response.view = self
    response_class = Response

    def prepare_response(self, response):
        """
        Prepares response for the response cycle. Sets some headers, sets renderers, ...
        """
        if hasattr(response, 'request') and response.request is None:
            response.request = self.request
        # Always add these headers.
        response['Allow'] = ', '.join(allowed_methods(self))
        # sample to allow caching using Vary http header
        response['Vary'] = 'Authenticate, Accept'
        # merge with headers possibly set at some point in the view
        for name, value in self.headers.items():
            response[name] = value
        # set the views renderers on the response
        response.renderers = self.renderers
        # TODO: must disappear
        response.view = self
    response_class = Response

    def prepare_response(self, response):
        """
        Prepares response for the response cycle. Sets some headers, sets renderers, ...
        """
        if hasattr(response, 'request') and response.request is None:
            response.request = self.request
        # Always add these headers.
        response['Allow'] = ', '.join(allowed_methods(self))
        # sample to allow caching using Vary http header
        response['Vary'] = 'Authenticate, Accept'
        # merge with headers possibly set at some point in the view
        for name, value in self.headers.items():
            response[name] = value
        # set the views renderers on the response
        response.renderers = self.renderers
        # TODO: must disappear
        response.view = self
    response_class = Response

    def prepare_response(self, response):
        """
        Prepares response for the response cycle. Sets some headers, sets renderers, ...
        """
        if hasattr(response, 'request') and response.request is None:
            response.request = self.request
        # Always add these headers.
        response['Allow'] = ', '.join(allowed_methods(self))
        # sample to allow caching using Vary http header
        response['Vary'] = 'Authenticate, Accept'
        # merge with headers possibly set at some point in the view
        for name, value in self.headers.items():
            response[name] = value
        # set the views renderers on the response
        response.renderers = self.renderers
        # TODO: must disappear
        response.view = self
    response_class = Response

    def prepare_response(self, response):
        """
        Prepares response for the response cycle. Sets some headers, sets renderers, ...
        """
        if hasattr(response, 'request') and response.request is None:
            response.request = self.request
        # Always add these headers.
        response['Allow'] = ', '.join(allowed_methods(self))
        # sample to allow caching using Vary http header
        response['Vary'] = 'Authenticate, Accept'
        # merge with headers possibly set at some point in the view
        for name, value in self.headers.items():
            response[name] = value
        # set the views renderers on the response
        response.renderers = self.renderers
        # TODO: must disappear
        response.view = self
    response_class = Response

    def prepare_response(self, response):
        """
        Prepares response for the response cycle. Sets some headers, sets renderers, ...
        """
        if hasattr(response, 'request') and response.request is None:
            response.request = self.request
        # Always add these headers.
        response['Allow'] = ', '.join(allowed_methods(self))
        # sample to allow caching using Vary http header
        response['Vary'] = 'Authenticate, Accept'
        # merge with headers possibly set at some point in the view
        for name, value in self.headers.items():
            response[name] = value
        # set the views renderers on the response
        response.renderers = self.renderers
        # TODO: must disappear
        response.view = self
          self.response = response
  
          try:
              renderer, media_type = self._determine_renderer(self.request)
          except ErrorResponse, exc:
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Response as a subclass of HttpResponse - first draft, not quite there yet. 
djangorestframework/mixins.py