Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

visitor IP address django

def visitor_ip_address(request):

    x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')

    if x_forwarded_for:
        return x_forwarded_for.split(',')[0]
    return request.META.get('REMOTE_ADDR')
Comment

PREVIOUS NEXT
Code Example
Python :: dataframe plot histogram 
Python :: convert a dictionary to pandas dataframe 
Python :: /bin/sh: 1: python: not found 
Python :: Double-Linked List Python 
Python :: pandas for column in dataframe 
Python :: zscore python 
Python :: flask quickstart 
Python :: pandas take first n rows 
Python :: extract tgz files in python 
Python :: python print variables and string 
Python :: regular expression to remove space python 
Python :: how to file in python 
Python :: python function returns function 
Python :: python remove everything after character 
Python :: all pdf in a directory to csv python 
Python :: reload flask on change 
Python :: python epoch to datetime 
Python :: System.Windows.Forms.DataGridView.CurrentRow.get returned null. c# 
Python :: django migrate not creating tables 
Python :: python sum array 
Python :: django filter by date range 
Python :: dataframe KeyError: 
Python :: evaluate how much a python program memory 
Python :: python return specific elements from list 
Python :: how to change size of turtle in python 
Python :: python set day of date to 1 
Python :: count number of each item in list python 
Python :: python cmd exec 
Python :: tabula python pdf to csv 
Python :: calculate percentile pandas dataframe 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =