              if obj.microsecond:
                  representation = representation[:12]
              return representation
          elif isinstance(obj, datetime.timedelta):
              return str(obj.total_seconds())
          elif isinstance(obj, decimal.Decimal):
              # Serializers will coerce decimals to strings by default.
              return float(obj)
          elif isinstance(obj, QuerySet):
              return list(obj)
 
</s> remove                 'CONTENT_TYPE':   str(content_type),
 </s> add                 'CONTENT_TYPE':   six.text_type(content_type), </s> remove             (str(key), key) for key in self.choices.keys()
 </s> add             (six.text_type(key), key) for key in self.choices.keys() </s> remove             value = decimal.Decimal(str(value).strip())
 </s> add             value = decimal.Decimal(six.text_type(value).strip()) </s> remove reverse_lazy = lazy(reverse, str)
 </s> add reverse_lazy = lazy(reverse, six.text_type) </s> remove         return str(data).strip()
 </s> add         return six.text_type(data).strip()
            return six.text_type(obj.total_seconds())
              if obj.microsecond:
                  representation = representation[:12]
              return representation
          elif isinstance(obj, datetime.timedelta):
            return six.text_type(obj.total_seconds())
          elif isinstance(obj, decimal.Decimal):
              # Serializers will coerce decimals to strings by default.
              return float(obj)
          elif isinstance(obj, QuerySet):
              return list(obj)
keep keep keep keep replace keep keep keep keep keep
 Use six.text_type instead of str everywhere 
rest_framework/utils/encoders.py