I've done a query with GeoDjango to show the places closest to the user, but it is returning the following error:

Only numeric values of degree units are allowed on geodetic distance queries.

My model looks like this:

class Local(models.Model):
    location = models.PointField()

My query:

user_location = Point(latitude, longitude, srid=4326)
Local.objects.filter(location__distance_lt=(user_location, D(m=500)))

I am using MySQL as database

Anyone know how I can solve this?

0 Answers