# 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:
```bash
pip install django-client-ip
```
2. Add the middleware to your Django project in settings.py:
```python
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](mailto:cumulus13@gmail.com)
[](https://www.buymeacoffee.com/cumulus13)
[](https://ko-fi.com/cumulus13)
[Support me on Patreon](https://www.patreon.com/cumulus13)
Raw data
{
"_id": null,
"home_page": "https://github.com/cumulus13/django-client-ip",
"name": "django-client-ip",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Hadi Cahyadi",
"author_email": "cumulus13@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3a/b2/7c0fabb4495d99e76dac9d72fbdebf8a808e3f61d156aff967de56d7f44c/django_client_ip-0.12.tar.gz",
"platform": null,
"description": "# django-client-ip\r\n\r\n`django-client-ip` is a Django middleware that retrieves the client IP address and optionally fetches geolocation data using `ip-api.com`.\r\n\r\n## Installation\r\n\r\n1. Install the package using pip:\r\n```bash\r\npip install django-client-ip\r\n```\r\n\r\n2. Add the middleware to your Django project in settings.py:\r\n```python\r\nMIDDLEWARE = [\r\n # Other middlewares\r\n 'django_client_ip.GetClientIP',\r\n]\r\n```\r\n\r\n## Usage\r\nOnce installed, every `request` object will have a `client_ip` attribute containing the IP address and geolocation data (if available).\r\n\r\n## Author\r\n[Hadi Cahyadi](mailto:cumulus13@gmail.com)\r\n\r\n[](https://www.buymeacoffee.com/cumulus13)\r\n\r\n[](https://ko-fi.com/cumulus13)\r\n [Support me on Patreon](https://www.patreon.com/cumulus13)\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Django middleware for retrieving client IP addresses and geolocation using ip-api.com",
"version": "0.12",
"project_urls": {
"Homepage": "https://github.com/cumulus13/django-client-ip"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "86ebf08bdba69522e56c7e0d686c0a8c180b1183a2aade7be4b9e3dbcdb292ef",
"md5": "8cdecd2ac555c9f2f2a4e2e9ff2066e1",
"sha256": "4f1f51b4fa1b9ad72fa5b537ba86ec3ac97d73ba4f55854394edafe6f207b100"
},
"downloads": -1,
"filename": "django_client_ip-0.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8cdecd2ac555c9f2f2a4e2e9ff2066e1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3552,
"upload_time": "2024-10-17T14:24:15",
"upload_time_iso_8601": "2024-10-17T14:24:15.225564Z",
"url": "https://files.pythonhosted.org/packages/86/eb/f08bdba69522e56c7e0d686c0a8c180b1183a2aade7be4b9e3dbcdb292ef/django_client_ip-0.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3ab27c0fabb4495d99e76dac9d72fbdebf8a808e3f61d156aff967de56d7f44c",
"md5": "98917da2f59463ebbbb05926fa360a12",
"sha256": "6b51e0b19468511dde34827cb030ab10ce77f0acee7aa04c192585f3be079650"
},
"downloads": -1,
"filename": "django_client_ip-0.12.tar.gz",
"has_sig": false,
"md5_digest": "98917da2f59463ebbbb05926fa360a12",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3396,
"upload_time": "2024-10-17T14:24:17",
"upload_time_iso_8601": "2024-10-17T14:24:17.349448Z",
"url": "https://files.pythonhosted.org/packages/3a/b2/7c0fabb4495d99e76dac9d72fbdebf8a808e3f61d156aff967de56d7f44c/django_client_ip-0.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-17 14:24:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cumulus13",
"github_project": "django-client-ip",
"github_not_found": true,
"lcname": "django-client-ip"
}