The geoip2 python package will help you get location information from the
the IP.
Inserting the data into a database via the ORM is fairly straight forward.
If you haven't worked with the ORM yet, this part of the django tutorial
should get you pointed in the right direction:
https://docs.djangoproject.com/en/4.0/intro/tutorial02/#playing-with-the-api

Kind Regards,
Michael Thomas

On Thu, Dec 16, 2021 at 3:08 PM Amor Zamora <amorza0...@gmail.com> wrote:

> Can you help me?
> I need to obtain the country of where the users access from the IP and
> insert that information into the sqlite3 database.
>
> Little description.
> I have an application that I have to do the statistics and insert into the
> sqlite3 database, the IP information, the country from which it is
> accessed, who generates the information and how many times has clicked on
> the application.
> Question 1 is that I cannot find any suitable module in DJango that allows
> me to combine the information described above.
> I am using. IP_address, os, daemonize and socket and I don't quite realize
> how to get the country from where it is accessed.
> Thanks
>
> --
> Amor Zamora
> Behind the distance,
> your mouth and mine hide,
> complices of a kiss, caresses, fantasies,
> distance as close as the sky and the sea,
> my piece is in your bed, in mine, is your love.
> Behind the distance hide love, memories,
> encounters, experiences, circumstances, pain and good times,
> it is after her, the distant ones,
> that we leave feelings,
> but if we really miss,
> distance,
> it is only your time.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKMTbHXbM4QFh5kRiShsroObKjefGzvRchX5m3S2ps6M95bwgQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKMTbHXbM4QFh5kRiShsroObKjefGzvRchX5m3S2ps6M95bwgQ%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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEdx1fpn3NzS2U%2BqoCfk%2BsL%2BKbpz72HCYX105LrV6TaXpuwamQ%40mail.gmail.com.

Reply via email to