  from urllib import quote
  register = Library()
  
  def add_query_param(url, param):
      (key, val) = param.split('=')
      param = '%s=%s' % (key, quote(val))
      (scheme, netloc, path, params, query, fragment) = urlparse(url)
      if query:
          query += "&" + param
      else:
 
</s> remove             content = renderer(self).render()
 </s> add             content = renderer.render() </s> remove from djangorestframework.utils.mediatypes import get_media_type_params, add_media_type_param
 </s> add from djangorestframework.utils.mediatypes import get_media_type_params, add_media_type_param, media_type_matches </s> remove             self.initial(request, *args, **kwargs)

            # Authenticate and check request has the relevant permissions
            self._check_permissions()

            # Get the appropriate handler method
            if self.method.lower() in self.http_method_names:
                handler = getattr(self, self.method.lower(), self.http_method_not_allowed)
            else:
                handler = self.http_method_not_allowed

            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)

            # Pre-serialize filtering (eg filter complex objects into natively serializable types)
            response.cleaned_content = self.filter_response(response.raw_content)
 </s> add             self.request = request
            self.args = args
            self.kwargs = kwargs </s> remove class MockView(ResponseMixin, DjangoView):
    def get(self, request):
        response = Response(DUMMYSTATUS, DUMMYCONTENT)
        return self.render(response)

 </s> add 
    (key, sep, val) = param.partition('=')
  from urllib import quote
  register = Library()
  
  def add_query_param(url, param):
    (key, sep, val) = param.partition('=')
      param = '%s=%s' % (key, quote(val))
      (scheme, netloc, path, params, query, fragment) = urlparse(url)
      if query:
          query += "&" + param
      else:
keep keep keep keep 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/templatetags/add_query_param.py