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
- Install the package using pip:
pip install django-client-ip
- 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
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b51e0b19468511dde34827cb030ab10ce77f0acee7aa04c192585f3be079650 |
|
MD5 | 98917da2f59463ebbbb05926fa360a12 |
|
BLAKE2b-256 | 3ab27c0fabb4495d99e76dac9d72fbdebf8a808e3f61d156aff967de56d7f44c |
File details
Details for the file django_client_ip-0.12-py3-none-any.whl
.
File metadata
- Download URL: django_client_ip-0.12-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1f51b4fa1b9ad72fa5b537ba86ec3ac97d73ba4f55854394edafe6f207b100 |
|
MD5 | 8cdecd2ac555c9f2f2a4e2e9ff2066e1 |
|
BLAKE2b-256 | 86ebf08bdba69522e56c7e0d686c0a8c180b1183a2aade7be4b9e3dbcdb292ef |