Skip to content

django-xxx/django-ip

Repository files navigation

django-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',
    ...
)

About

Simple return user's real IP address in Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published