              if hasattr(self, 'resolve_context'):
                  context = self.resolve_context(data, request, response)
              else:
                  context = self.get_template_context(data, renderer_context)
              return template_render(template, context, request=request)
  
          return data
  
  
  class HTMLFormRenderer(BaseRenderer):
 
</s> remove         return template_render(template, context, request=request)
 </s> add         return template.render(context, request=request) </s> remove         ret = template_render(template, context, request=renderer_context['request'])
 </s> add         ret = template.render(context, request=renderer_context['request']) </s> remove         ret = template_render(template, context, request=renderer_context['request'])
 </s> add         ret = template.render(context, request=renderer_context['request']) </s> remove def template_render(template, context=None, request=None):
    """
    Passing Context or RequestContext to Template.render is deprecated in 1.9+,
    see https://github.com/django/django/pull/3883 and
    https://github.com/django/django/blob/1.9/django/template/backends/django.py#L82-L84

    :param template: Template instance
    :param context: dict
    :param request: Request instance
    :return: rendered template as SafeText instance
    """
    if isinstance(template, Template):
        if request:
            context = RequestContext(request, context)
        else:
            context = Context(context)
        return template.render(context)
    # backends template, e.g. django.template.backends.django.Template
    else:
        return template.render(context, request=request)


def set_many(instance, field, value):
    if django.VERSION < (1, 10):
        setattr(instance, field, value)
    else:
        field = getattr(instance, field)
        field.set(value)


def include(module, namespace=None, app_name=None):
    from django.conf.urls import include
    if django.VERSION < (1,9):
        return include(module, namespace, app_name)
    else:
        return include((module, app_name), namespace)


 </s> add  </s> remove         return template_render(template, context)
 </s> add         return template.render(context)
            return template.render(context, request=request)
              if hasattr(self, 'resolve_context'):
                  context = self.resolve_context(data, request, response)
              else:
                  context = self.get_template_context(data, renderer_context)
            return template.render(context, request=request)
  
          return data
  
  
  class HTMLFormRenderer(BaseRenderer):
keep keep keep keep replace keep keep keep keep keep
 Remove Django 1.8 & 1.9 compatibility code (#5481)

* Identify code that needs to be pulled out of/removed from compat.py

* Extract modern code from get_names_and_managers in compat.py and remove compat code

* Extract modern code from is_authenticated() in compat.py and remove.

* Extract modern code from is_anonymous() in compat.py and remove

* Extract modern code from get_related_model() from compat.py and remove

* Extract modern code from value_from_object() in compat.py and remove

* Update postgres compat

JSONField now always available.

* Remove DecimalValidator compat

* Remove get_remote_field compat

* Remove template_render compat

Plus isort.

* Remove set_many compat

* Remove include compat 
rest_framework/renderers.py