Skip to content

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

License

Notifications You must be signed in to change notification settings

cumulus13/django_client_ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages