How to get logged in user location and save it in database

204 views
Skip to first unread message

Ram

unread,
Oct 1, 2020, 12:29:51 AM10/1/20
to django...@googlegroups.com
Hi All,

I'm looking for a way to capture location of logged in users in our Web App and save that location into our database.

Basically if we could capture this location, we would like to use it around members account features.

Please let me know if you have suitable pointers for this.

Thanks in advance,
~Ram

RANGA BHARATH JINKA

unread,
Oct 1, 2020, 12:37:24 AM10/1/20
to django...@googlegroups.com
Hi, 

   Use javascript location api

   All the best

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BOi5F1T1X_Q-GGSqKp4f-fRhY4qfu8Y12-XcNUGcEmUSGQ9AA%40mail.gmail.com.


--
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

Ram

unread,
Oct 1, 2020, 2:04:50 AM10/1/20
to django...@googlegroups.com
Thank you very much, Ranga for the pointer. We actually need to capture the location of the IP address, like "Where" attribute in this  example. So where attribute should also include nearest city name in that country.

image.png


Best Regards,
~Ram

RANGA BHARATH JINKA

unread,
Oct 1, 2020, 2:08:41 AM10/1/20
to django...@googlegroups.com
I think you can find out city name using IP address. Use JavaScript or there are some python modules also.
All the best 👍

Andréas Kühne

unread,
Oct 1, 2020, 3:09:15 AM10/1/20
to django...@googlegroups.com
You can use built in functionality for this.

All you need is an up to date IP address database. You can find one here:
https://www.maxmind.com/en/geoip2-services-and-databases

The geoip handling in Django will then help you find where the IP address is:
https://docs.djangoproject.com/en/3.1/ref/contrib/gis/geoip2/

Regards,

Andréas


Dvs Khamele

unread,
Oct 11, 2020, 1:25:10 PM10/11/20
to django...@googlegroups.com, ram.mu...@gmail.com
Hi do you hire contract based python/django freelancer?
 We can help you in this and related techincal tasks at fair prices. Reply or send email to div...@pythonmate.com
Best Regards, 
Divyesh Khamele,
Pythonmate


--

Ram

unread,
Oct 11, 2020, 1:56:00 PM10/11/20
to Dvs Khamele, django...@googlegroups.com
Thank you all for your valuable pointers.

Best Regards,
~Ram
Reply all
Reply to author
Forward
0 new messages