  
          try:
              http_prefix = value.startswith('http:') or value.startswith('https:')
          except AttributeError:
              msg = self.error_messages['invalid']
              raise ValidationError(msg)
  
          if http_prefix:
              # If needed convert absolute URLs to relative path
              value = urlparse(value).path
              prefix = get_script_prefix()
 
</s> remove             msg = self.error_messages['invalid']
 </s> add             received = type(data).__name__
            msg = self.error_messages['incorrect_type'] % received </s> remove             msg = self.error_messages['invalid']
 </s> add             received = type(data).__name__
            msg = self.error_messages['incorrect_type'] % received </s> remove             msg = self.error_messages['invalid']
            raise ValidationError(msg)
 </s> add             msg = self.error_messages['incorrect_type']
            raise ValidationError(msg % type(value).__name__) </s> remove         'invalid': _('Invalid value.'),
 </s> add         'incorrect_type': _('Incorrect type.  Expected url string, received %s.'),
            msg = self.error_messages['incorrect_type']
            raise ValidationError(msg % type(value).__name__)
  
          try:
              http_prefix = value.startswith('http:') or value.startswith('https:')
          except AttributeError:
            msg = self.error_messages['incorrect_type']
            raise ValidationError(msg % type(value).__name__)
            msg = self.error_messages['incorrect_type']
            raise ValidationError(msg % type(value).__name__)
  
          if http_prefix:
              # If needed convert absolute URLs to relative path
              value = urlparse(value).path
              prefix = get_script_prefix()
keep keep keep keep replace replace keep keep keep keep keep
 Raise Validation Errors when relationships receive incorrect types. Fixes #590. 
rest_framework/relations.py