skip to navigation
skip to content

django-ip 1.0.2

Django Client IP

Simple return user’s real IP address in Django

Installation

pip install django-ip

Usage

# Need Setting
request.client_ip

# Not Need Setting
from ipaddr import client_ip
def xxx(request):
    ipaddr = client_ip(request)

Settings.py

# Use `MIDDLEWARE_CLASSES` prior to Django 1.10
MIDDLEWARE = (
    ...
    'ipaddr.middleware.IPAddrMiddleware',
    ...
)
 
File Type Py Version Uploaded on Size
django-ip-1.0.2.tar.gz (md5) Source 2017-09-25 1KB
django_ip-1.0.2-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2017-09-25 3KB