              # Try to find an appropriate error template
              return self.resolve_template(template_names)
          except Exception:
              # Fall back to using eg '404 Not Found'
              return Template('%d %s' % (response.status_code,
                                         response.status_text.title()))
  
  
  # Note, subclass TemplateHTMLRenderer simply for the exception behavior
  class StaticHTMLRenderer(TemplateHTMLRenderer):
      """
 
</s> remove         ret = template_render(template, context, request=renderer_context['request'])
 </s> add         ret = template.render(context, request=renderer_context['request']) </s> remove     for field in [field for field in opts.fields if field.serialize and get_remote_field(field)]:
 </s> add     for field in [field for field in opts.fields if field.serialize and field.remote_field]: </s> remove         return template_render(template, context)
 </s> add         return template.render(context) </s> remove try:
    # DecimalValidator is unavailable in Django < 1.9
    from django.core.validators import DecimalValidator
except ImportError:
    DecimalValidator = None
 </s> add  </s> remove # Obtaining manager instances and names from model options differs after 1.10.
def get_names_and_managers(options):
    if django.VERSION >= (1, 10):
        # Django 1.10 onwards provides a `.managers` property on the Options.
        return [
            (manager.name, manager)
            for manager
            in options.managers
        ]
    # For Django 1.8 and 1.9, use the three-tuple information provided
    # by .concrete_managers and .abstract_managers
    return [
        (manager_info[1], manager_info[2])
        for manager_info
        in (options.concrete_managers + options.abstract_managers)
    ]


# field.rel is deprecated from 1.9 onwards
def get_remote_field(field, **kwargs):
    if 'default' in kwargs:
        if django.VERSION < (1, 9):
            return getattr(field, 'rel', kwargs['default'])
        return getattr(field, 'remote_field', kwargs['default'])

    if django.VERSION < (1, 9):
        return field.rel
    return field.remote_field


 </s> add 
            body = '%d %s' % (response.status_code, response.status_text.title())
            template = engines['django'].from_string(body)
            return template
              # Try to find an appropriate error template
              return self.resolve_template(template_names)
          except Exception:
              # Fall back to using eg '404 Not Found'
            body = '%d %s' % (response.status_code, response.status_text.title())
            template = engines['django'].from_string(body)
            return template
            body = '%d %s' % (response.status_code, response.status_text.title())
            template = engines['django'].from_string(body)
            return template
  
  
  # Note, subclass TemplateHTMLRenderer simply for the exception behavior
  class StaticHTMLRenderer(TemplateHTMLRenderer):
      """
keep keep keep keep replace 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