GeoDjango is not respecting SRIDs with MySQL 8.
I created a new column geo_code = PointField(srid=4326) and ran makemigrations. Running sqlmigrate on the generated migration gives BEGIN; -- -- Create model Location -- CREATE TABLE `locations_location` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `geo_code` POINT NOT NULL); CREATE SPATIAL INDEX `locations_location_geo_code_id` ON `locations_location`(`geo_code`); COMMIT; See how the SRID was ignored. Now anything I add to this column is using SRID 0 - which is incorrect. I get wrong results if I use the `ST_DISTANCE` function with SRID 0. I tried using `migrations.SeparateDatabaseAndState` to create the column with the correct SRID constraint with the following SQL ALTER TABLE backend_userprofile ADD COLUMN geocode_point POINT NULL SRID 4326; Now if I try inserting data into this column I get the following error django.db.utils.OperationalError: (3643, "The SRID of the geometry does not match the SRID of the column 'geocode_point'. The SRID of the geometry is 0, but the SRID of the column is 4326. Consider changing the SRID of the geometry or the SRID property of the column.") Django is still trying to insert data with SRID 0 and MySQL raises and error because the column has a constrain on SRID. Is there a way to make Django work with correct SRIDs? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7c36ebcd-8618-4357-a88f-5d29ca2ddf49%40googlegroups.com.