Get user geolocation on submit

Hi,
I am trying to create a webapp for a finance company to maintain records of their collection agents. One of their main requirement is to know the agent’s location, like a tracking system. Their admins want to know where the agents are all the time. Agents would be using the webapp on the mobile or a tablet so i am guessing django should be able to access the phone’s location. Also when an agent enters a collection in the webapp, a location of where the collection was made should also be added to the database.
Basically if know how to get the current location i could try and figure out a way to do the rest. As i went through the internet for a solution, i found certain APIs and tools like GeoIP, the best they return is the city and even that is a wild guess based on the ip address. What i would like to get is a more precise location using the mobile’s location.
This is a new concept for me, i’d really appreciate it if someone can help me with this.

Django can’t get this information because it is running on the server, but JavaScript can - if it’s granted permission by the user to do so.

However, there are a lot of caveats associated with this. I suggest you start with the docs at Geolocation API - Web APIs | MDN.

You’ll want to know what degree of accuracy is required. Also be aware that there’s a wide range in accuracy between brands and models of phones.

If you’re write a native app for the mobile environment, you’re likely going to get more accurate information. (At least we found this to be true about 5 years ago when we did some work in this area.)