              if wkt_m:
                  # Handling WKT input.
                  if wkt_m.group('srid'):
                      input_srid = int(wkt_m.group('srid'))
                  g = wkt_r().read(force_bytes(wkt_m.group('wkt')))
              elif hex_regex.match(geo_input):
                  # Handling HEXEWKB input.
                  g = wkb_r().read(force_bytes(geo_input))
              elif json_regex.match(geo_input):
                  # Handling GeoJSON input.
 
</s> remove             if other.startswith('SRID=0;'):
                return self.ewkt == other[7:]  # Test only WKT part of other
            return self.ewkt == other
        elif isinstance(other, GEOSGeometry):
            return self.srid == other.srid and self.equals_exact(other)
        else:
            return False
 </s> add             try:
                other = GEOSGeometry.from_ewkt(other)
            except (ValueError, GEOSException):
                return False
        return isinstance(other, GEOSGeometry) and self.srid == other.srid and self.equals_exact(other)
                g = self._from_wkt(force_bytes(wkt_m.group('wkt')))
              if wkt_m:
                  # Handling WKT input.
                  if wkt_m.group('srid'):
                      input_srid = int(wkt_m.group('srid'))
                g = self._from_wkt(force_bytes(wkt_m.group('wkt')))
              elif hex_regex.match(geo_input):
                  # Handling HEXEWKB input.
                  g = wkb_r().read(force_bytes(geo_input))
              elif json_regex.match(geo_input):
                  # Handling GeoJSON input.
keep keep keep keep replace keep keep keep keep keep
 Fixed #28433 -- Made GEOSGeometry.__eq__() work correctly with non-canonical EWKT string. 
django/contrib/gis/geos/geometry.py