Django Request Viewer

Log and view requests made on your Django App

Recently, @ichtrojan and @toniastro released horus, a request logger and viewer for Go. Then I felt the need for something like that for the Django community.

Installation

Install using pip

pip install django-request-viewer

Usage

Add 'request-viewer' to your INSTALLED_APPS in settings.py.

INSTALLED_APPS = [
    ...
    'request_viewer',
    ...
]

Add 'request_viewer.middleware.RequestViewerMiddleware' to your MIDDLEWARE list in settings.py.

MIDDLEWARE = [
    ...
    'request_viewer.middleware.RequestViewerMiddleware',
    ...
]  

Add 'request-viewer' to your main urls.py

urlpatterns = [
  ...
  path('logs/', include('request_viewer.urls'))
  ...
]

Run migrations, python manage.py migrate request-viewer

OPTIONAL

Add REQUEST_VIEWER dictionary to your settings.py.

LIVE_MONITORING: Default: True, False to pause monitoring.

WHITELISTED_PATHS: Default: [], This is a list of paths to be excluded when monitoring

{
  "LIVE_MONITORING": True,
  "WHITELISTED_PATHS": ['admin/']
}

Note: Media url, Static url and request-viewer url are automatically excluded.


Start your server and head to http://localhost:8000/log/request-viewer
≤br>

View your request logs.

Screenshot 2021-03-29 at 09 30 33

Contribute

Well, no big drama, fork the repo and make pull requests, easy peasy, right?

TODO

  • Exceptions logger
  • Create an African unicorn
  • Buy a yacht

GitHub

https://github.com/sirrobot01/django-request-viewer