      def to_internal_value(self, data):
          """
          Dict of native values <- Dict of primitive datatypes.
          """
          if not isinstance(data, dict):
              message = self.error_messages['invalid'].format(
                  datatype=type(data).__name__
              )
              raise ValidationError({
                  api_settings.NON_FIELD_ERRORS_KEY: [message]
 
</s> remove             key: value if isinstance(value, (list, dict)) else [value]
 </s> add             key: value if isinstance(value, (list, Mapping)) else [value] </s> remove     if isinstance(detail, dict):
 </s> add     if isinstance(detail, Mapping): </s> remove from collections import OrderedDict
 </s> add from collections import Mapping, OrderedDict
        if not isinstance(data, Mapping):
      def to_internal_value(self, data):
          """
          Dict of native values <- Dict of primitive datatypes.
          """
        if not isinstance(data, Mapping):
              message = self.error_messages['invalid'].format(
                  datatype=type(data).__name__
              )
              raise ValidationError({
                  api_settings.NON_FIELD_ERRORS_KEY: [message]
keep keep keep keep replace keep keep keep keep keep
 Check for collection.Mapping instead of dict

issue #4901 
rest_framework/serializers.py