      def get_context(self, data, accepted_media_type, renderer_context):
          """
          Render the HTML for the browsable API representation.
          """
          context = super(AdminRenderer, self).get_context(
              data, accepted_media_type, renderer_context
          )
  
          paginator = getattr(context['view'], 'paginator', None)
          if paginator is not None and data is not None:
 
</s> remove             content_type = "{0}; charset={1}".format(media_type, charset)
 </s> add             content_type = "{}; charset={}".format(media_type, charset) </s> remove         return super(APIRequestFactory, self).generic(
 </s> add         return super().generic( </s> remove         if isinstance(ret, six.text_type):
 </s> add         if isinstance(ret, str): </s> remove         super(APIRequestFactory, self).__init__(**defaults)
 </s> add         super().__init__(**defaults) </s> remove         request = factory.put('/{0}'.format(filtered_out_pk), data, format='json')
 </s> add         request = factory.put('/{}'.format(filtered_out_pk), data, format='json')
        context = super().get_context(
      def get_context(self, data, accepted_media_type, renderer_context):
          """
          Render the HTML for the browsable API representation.
          """
        context = super().get_context(
              data, accepted_media_type, renderer_context
          )
  
          paginator = getattr(context['view'], 'paginator', None)
          if paginator is not None and data is not None:
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/renderers.py