Tracking IP

30 views
Skip to first unread message

Soumen Khatua

unread,
Jan 21, 2020, 6:57:42 AM1/21/20
to django...@googlegroups.com
Hi Folks,

In my Django application I want to show IP address of users, Just like others financial websites. How I can do that using Django(of course it's should be free cost).

Thank You in advance

Regards,
Soumen

bharat pamnani

unread,
Jan 21, 2020, 7:00:12 AM1/21/20
to django...@googlegroups.com
hostname -I will give you the ip of user.

--
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/CAPUw6WZX_VEzB3jCR4DvOTUE08JXifr9todeHHUP29MumgrM2w%40mail.gmail.com.

Soumen Khatua

unread,
Jan 21, 2020, 7:09:50 AM1/21/20
to django...@googlegroups.com
I want to show the users/clients IP address



Roger Gammans

unread,
Jan 21, 2020, 7:35:31 AM1/21/20
to django...@googlegroups.com
Hi

The precise details of this depend on your hosting environment, but the canonical method is request.get_host() ; see https://docs.djangoproject.com/en/3.0/ref/request-response/#django.http.HttpRequest.get_host

If your hosting environment is non-standard; you might need some custom middleware to help, as per the discussion in the link documentation.

Kasper Laudrup

unread,
Jan 21, 2020, 12:50:16 PM1/21/20
to django...@googlegroups.com
Hi,

On 21/01/2020 13.34, Roger Gammans wrote:
> Hi
>
> The precise details of this depend on your hosting environment, but the
> canonical method is request.get_host() ; see
> https://docs.djangoproject.com/en/3.0/ref/request-response/#django.http.HttpRequest.get_host
>
> If your hosting environment is non-standard; you might need some custom
> middleware to help, as per the discussion in the link documentation.
>

Be aware that it's trivial to spoof this so don't rely on this to be
accurate and don't ever rely on this for anything security related.

Kind regards,

Kasper Laudrup

Soumen Khatua

unread,
Jan 21, 2020, 1:11:36 PM1/21/20
to django...@googlegroups.com
ok


--
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.

maninder singh Kumar

unread,
Jan 22, 2020, 2:56:02 AM1/22/20
to django...@googlegroups.com
You could request.hostname or request.path to get to the names. 
 
               
 


On Tue, Jan 21, 2020 at 5:27 PM Soumen Khatua <soumenk...@gmail.com> wrote:
--
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.
Reply all
Reply to author
Forward
0 new messages