1

I want to get my current location in django so that I can compare the distance with my location and other city.

 lat1, lon1 = origin     #current location 
 lat2, lon2 = destination  #location of other city

Further I want to compare between these two for a distance. I have destination lat and long but looking for current lat and long

Aditi Sharma
  • 303
  • 2
  • 14
  • What do you expect to be the source of the location information? – Klaus D. Jan 09 '19 at 05:48
  • I'm not sure but looking for some method that can automatically select my location. – Aditi Sharma Jan 09 '19 at 05:53
  • 2
    On SO it is expected that you have done some research on the topic already. – Klaus D. Jan 09 '19 at 06:00
  • I think you can use this answer: https://stackoverflow.com/a/7423314/2696165 its not django based, and probably it is best to use google maps api for that. You can also look into GeoDjango for distance calculation. – ruddra Jan 09 '19 at 08:05

1 Answers1

0

I am not sure how you want to use, but it looks like GeoLocation in Django will help you. Go through this documentation once. GeoIP2.

ArtOfWarfare
  • 20,617
  • 19
  • 137
  • 193
Sulove Bista
  • 118
  • 8