          kwargs['read_only'] = True
          super(StringRelatedField, self).__init__(**kwargs)
  
      def to_representation(self, value):
          return str(value)
  
  
  class PrimaryKeyRelatedField(RelatedField):
      default_error_messages = {
          'required': 'This field is required.',
 
</s> remove         return str(value)
 </s> add         return six.text_type(value) </s> remove         return self.choice_strings_to_values[str(value)]
 </s> add         return self.choice_strings_to_values[six.text_type(value)] </s> remove         return str(value).strip()
 </s> add         return six.text_type(value).strip() </s> remove             return self.represent_scalar('tag:yaml.org,2002:str', str(data))
 </s> add             return self.represent_scalar('tag:yaml.org,2002:str', six.text_type(data)) </s> remove         return str(data)
 </s> add         return six.text_type(data)
        return six.text_type(value)
          kwargs['read_only'] = True
          super(StringRelatedField, self).__init__(**kwargs)
  
      def to_representation(self, value):
        return six.text_type(value)
  
  
  class PrimaryKeyRelatedField(RelatedField):
      default_error_messages = {
          'required': 'This field is required.',
keep keep keep keep replace keep keep keep keep keep
 Use six.text_type instead of str everywhere 
rest_framework/relations.py