I have a model that stores the location of users:
[ { "url": "http://192.168.0.22:8000/status/1/", "id": 1, "owner": 1, "test_info": "", "created_at": "2015-05-02T07:09:16.535689Z", "updated_at": "2015-05-02T07:09:16.535746Z", "geolocation": null, "jukebox_mode_enabled": false }, { "url": "http://192.168.0.22:8000/status/2/", "id": 2, "owner": 2, "test_info": "", "created_at": "2015-05-02T07:09:24.206959Z", "updated_at": "2015-05-02T07:09:24.207042Z", "geolocation": null, "jukebox_mode_enabled": false },
I'm trying to create a system that allows users to query and see who else is nearby, but for security reasons, I would like to limit the results to users, say, 1KM.
What is the best way to achieve this?
PS - "status" is tied to the normal user model in the django model using oneToOneField.
python django django-rest-framework geolocation
jwv
source share