Skip to main content

A Django middleware for retrieving client IP addresses and geolocation using ip-api.com

Project description

django-client-ip

django-client-ip is a Django middleware that retrieves the client IP address and optionally fetches geolocation data using ip-api.com.

Installation

  1. Install the package using pip:
pip install django-client-ip
  1. Add the middleware to your Django project in settings.py:
MIDDLEWARE = [
    # Other middlewares
    'django_client_ip.GetClientIP',
]

Usage

Once installed, every request object will have a client_ip attribute containing the IP address and geolocation data (if available).

Author

Hadi Cahyadi

Buy Me a Coffee

Donate via Ko-fi Support me on Patreon

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_client_ip-0.12.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

django_client_ip-0.12-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file django_client_ip-0.12.tar.gz.

File metadata

  • Download URL: django_client_ip-0.12.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for django_client_ip-0.12.tar.gz
Algorithm Hash digest
SHA256 6b51e0b19468511dde34827cb030ab10ce77f0acee7aa04c192585f3be079650
MD5 98917da2f59463ebbbb05926fa360a12
BLAKE2b-256 3ab27c0fabb4495d99e76dac9d72fbdebf8a808e3f61d156aff967de56d7f44c

See more details on using hashes here.

File details

Details for the file django_client_ip-0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for django_client_ip-0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4f1f51b4fa1b9ad72fa5b537ba86ec3ac97d73ba4f55854394edafe6f207b100
MD5 8cdecd2ac555c9f2f2a4e2e9ff2066e1
BLAKE2b-256 86ebf08bdba69522e56c7e0d686c0a8c180b1183a2aade7be4b9e3dbcdb292ef

See more details on using hashes here.

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