Created
September 5, 2021 20:11
-
-
Save joeypy/625cb1f58a1bd52936992664e607650d to your computer and use it in GitHub Desktop.
Get the IP address from the client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_view(request): | |
... | |
... | |
client_ip = request.META['REMOTE_ADDR'] | |
#or client_ip = request.META['X_FORWARDED_FOR'] | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment