              # Use standard HTTP Accept negotiation
              accept_list = request.META["HTTP_ACCEPT"].split(',')
          else:
              # No accept header specified
              return self._default_renderer
          
          # Parse the accept header into a dict of {qvalue: set of media types}
          # We ignore mietype parameters
          accept_dict = {}    
          for token in accept_list:
              components = token.split(';')
              mimetype = components[0].strip()
              qvalue = Decimal('1.0')
              
              if len(components) > 1:
                  # Parse items that have a qvalue eg 'text/html; q=0.9'
                  try:
                      (q, num) = components[-1].split('=')
                      if q == 'q':
                          qvalue = Decimal(num)
                  except:
                      # Skip malformed entries
                      continue
  
              if accept_dict.has_key(qvalue):
                  accept_dict[qvalue].add(mimetype)
              else:
                  accept_dict[qvalue] = set((mimetype,))
          
          # Convert to a list of sets ordered by qvalue (highest first)
          accept_sets = [accept_dict[qvalue] for qvalue in sorted(accept_dict.keys(), reverse=True)]
         
          for accept_set in accept_sets:
              # Return any exact match
              for renderer in self.renderers:
                  if renderer.media_type in accept_set:
 
</s> remove         for accept_set in accept_sets:
            # Return any exact match
            for renderer in self.renderers:
                if renderer.media_type in accept_set:
                    return renderer

            # Return any subtype match
            for renderer in self.renderers:
                if renderer.media_type.split('/')[0] + '/*' in accept_set:
                    return renderer

            # Return default
            if '*/*' in accept_set:
                return self._default_renderer
      

 </s> add         # No acceptable renderers were found </s> remove             accept_list = request.META["HTTP_ACCEPT"].split(',')
 </s> add             accept_list = [token.strip() for token in request.META["HTTP_ACCEPT"].split(',')] </s> remove             content = renderer(self).render()
 </s> add             content = renderer.render()
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
              # Use standard HTTP Accept negotiation
              accept_list = request.META["HTTP_ACCEPT"].split(',')
          else:
              # No accept header specified
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
            return self._default_renderer(self)

        # 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 :)
        #     We're effectivly looping over max len(accept_list) * len(self.renderers)
        renderers = [renderer_cls(self) for renderer_cls in self.renderers]

        for media_type_lst in order_by_precedence(accept_list):
            for renderer in renderers:
                for media_type in media_type_lst:
                    if renderer.can_handle_response(media_type):
                        return renderer
         
          for accept_set in accept_sets:
              # Return any exact match
              for renderer in self.renderers:
                  if renderer.media_type in accept_set:
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Renderers can now cope with parameterised args.  ResponseMixin gets cleaned up & added Renderer.can_handle_response(), mirroring Parsers.can_handle_request() 
djangorestframework/mixins.py