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


Den tors 1 okt. 2020 kl 08:08 skrev RANGA BHARATH JINKA <
[email protected]>:

> I think you can find out city name using IP address. Use JavaScript or
> there are some python modules also.
> All the best 👍
>
> On Thu, 1 Oct 2020, 11:34 am Ram, <[email protected]> wrote:
>
>> 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: image.png]
>>
>>
>> Best Regards,
>> ~Ram
>>
>> On Wed, Sep 30, 2020 at 10:36 PM RANGA BHARATH JINKA <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>>    Use javascript location api
>>>    https://www.w3schools.com/html/html5_geolocation.asp
>>>
>>>    All the best
>>>
>>> On Thu, Oct 1, 2020 at 9:59 AM Ram <[email protected]> wrote:
>>>
>>>> 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
>>>>
>>>> --
>>>> 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 [email protected].
>>>> 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
>>>> <https://groups.google.com/d/msgid/django-users/CA%2BOi5F1T1X_Q-GGSqKp4f-fRhY4qfu8Y12-XcNUGcEmUSGQ9AA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>> Thanks and Regards
>>>
>>> J. Ranga Bharath
>>> cell: 9110334114
>>>
>>> --
>>> 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 [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAK5m315QeHRHpv0kbg4OefdGUSDmNgSp7KbmsLEswVWPGNqd4g%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAK5m315QeHRHpv0kbg4OefdGUSDmNgSp7KbmsLEswVWPGNqd4g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2BOi5F1p-uCrkEVCobuB%3DE8srydue1Fp-H_%2BFv8W8gRkPiwhTA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CA%2BOi5F1p-uCrkEVCobuB%3DE8srydue1Fp-H_%2BFv8W8gRkPiwhTA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK5m316QhbiWzXA3NvOt6981ohFrcdNJiBu%2BCyFL4rm4zzkRig%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK5m316QhbiWzXA3NvOt6981ohFrcdNJiBu%2BCyFL4rm4zzkRig%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCeV6WyZihc_71aVFEPsQCXBS1yHE0gewSUfv-Vb_f4jgw%40mail.gmail.com.

Reply via email to