              # general GeometryField is used.
              if value.srid is None:
                  # Assigning the field SRID if the geometry has no SRID.
                  value.srid = self._field.srid
          elif value is None or isinstance(value, six.string_types + (six.memoryview,)):
              # Set geometries with None, WKT, HEX, or WKB
              pass
          else:
              raise TypeError('Cannot set %s SpatialProxy (%s) with value of type: %s' % (
                  instance.__class__.__name__, gtype, type(value)))
 
</s> remove         if gtype == 'RASTER' and (value is None or isinstance(value, six.string_types + (dict, self._klass))):
 </s> add         if gtype == 'RASTER' and (value is None or isinstance(value, (str, dict, self._klass))): </s> remove         elif f.geom_type == 'RASTER' and isinstance(value, six.string_types):
 </s> add         elif f.geom_type == 'RASTER' and isinstance(value, str): </s> remove         elif f.geom_type == 'RASTER' and isinstance(value, six.string_types):
 </s> add         elif f.geom_type == 'RASTER' and isinstance(value, str): </s> remove         if isinstance(srid, six.integer_types) or srid is None:
 </s> add         if isinstance(srid, int) or srid is None: </s> remove     if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
 </s> add     if isinstance(value, str):  # Handle strings first for performance reasons.
        elif value is None or isinstance(value, (str, memoryview)):
              # general GeometryField is used.
              if value.srid is None:
                  # Assigning the field SRID if the geometry has no SRID.
                  value.srid = self._field.srid
        elif value is None or isinstance(value, (str, memoryview)):
              # Set geometries with None, WKT, HEX, or WKB
              pass
          else:
              raise TypeError('Cannot set %s SpatialProxy (%s) with value of type: %s' % (
                  instance.__class__.__name__, gtype, type(value)))
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/contrib/gis/db/models/proxy.py