how can we get gps data of user's mobile and tablets in our django application?

438 Views Asked by At

In my django application I need to store the GPS data of all users to track them especially mobile and tablets how can I do so?

1

There are 1 best solutions below

2
On

You should create a table that it stores the locations. Your table schema is like below:

Location:

id (auto increment) | user (foreignkey to User) | lat (decimal) | long (decimal) | created_at (datetime)

Now you can provide an API that it receives lat,long and user(detect user by token or session) then store these data in the Location table.

In the client side, you should get the location from gps and send to the API.