Reputation: 1
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?
Upvotes: 0
Views: 455
Reputation: 821
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.
Upvotes: 0