I'm trying to make geodjango app. I'm using SQLite and SpatialLite. I want to add shops, and be able to sort them from closest to furthest from my location.
When in my model I have:
location = gis_models.PointField(srid=4326, blank=True, null=True)
then adding works, but sorting by distance does not work, and I get:
SQLite does not support linear distance calculations on geodetic coordinate systems.
When I have:
location = gis_models.PointField(srid=3857, blank=True, null=True)
than adding does not work, and sorting works, and I get:
geo_shop.location violates Geometry constraint [geom-type or SRID not allowed]
What do I do to make them both work at the same time?