This problem can be solved in pure SQL, if you do not mind very good accuracy.
GPS SQL:
latitude = 46.2037010192871
longitude = 5.20353984832764
query= "SELECT ID, NOM, LAT, LON, 3956 * 2 * ASIN(SQRT(POWER(SIN((%s - LAT) * 0.0174532925 / 2), 2) + COS(%s * 0.0174532925) * COS(LAT * 0.0174532925) * POWER(SIN((%s - LON) * 0.0174532925 / 2), 2) )) as distance from POI having distance < 50 ORDER BY distance ASC " % ( latitude, latitude, longitude)
gps 50 .
django :
from django.db import connection
cursor = connection.cursor()
cursor.execute( query )
rows = cursor.fetchall()
django