'django-request-logger' is a Django package designed to capture and store HTTP requests essential information, including IP address, user model, user agent, HTTP method, timestamp, and more.
Install the package using pip:
pip install django-request-track
-
Add request_track to your INSTALLED_APPS in your Django project's settings:
INSTALLED_APPS = [ # ... 'request_track', # ... ]
-
Register the middleware in your MIDDLEWARE settings:
MIDDLEWARE = [ # ... 'request_track.middleware.LoggingRequestMiddleware' ]
-
Migrate:
python manage.py migrate
After it all work will be done automatically and you can see the information through the Django admin panel or work with the "RequestLog" model.