I'm building an api to make distance lookups using Django 1.8, GeoDjango, Django REST Framework and PostGIS.
Locally I'm using PostGIS 2.1.7, my host (PythonAnywhere) uses 2.1.4... I'm not able to install an earlier version locally (not so strong with making and installing).
The problem is that locally an api request like http://localhost:8000/v1/test-entries/8.5513076999999988%2055.6684179999999955/ return nothing, as it should. But doing the same request (using the same coordinates) on the live version on PythonAnywhere return all entries in the DB. The code is the same both locally and on PA. The distance lookup code is like so:
return TestEntry.objects.filter(pnt__distance_lte=(pnt, 10))
The only difference I see is the PostGIS version, but it seems unlikely that such a basic functionality shouldn't work in an older version.
Does anyone have experience with these kinds of technologies and give me some hints to what could be wrong?
geometry
orgeography
? Please useST_SRID()
to check both have the same srid.