Skip to main content

Django Client IP

Project description

Simple return user’s real IP address in Django

Installation

pip install django-ip

Usage

# Need Setting
request.client_ip

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

Settings.py

# Use `MIDDLEWARE_CLASSES` prior to Django 1.10
MIDDLEWARE = (
    ...
    'ipaddr.middleware.IPAddrMiddleware',
    ...
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ip-1.0.0.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

django_ip-1.0.0-py2.py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page