I am trying to find the nearest point to a location using geodjango.
I tried using the following code:
LocationInfo.objects.filter(coordinates__distance_lte=(user_location, D(km=2)))
But It only works if the location is within the specified distance (D(km=2)
in this case).
I need to find the point nearest to the user without using any limit during query.