Skip to content

fanatid/django-requests-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Requests Monitor

The Django Requests Monitor stores debug information about requests and displayed on single page.

Installation

All also as well in django-debug-toolbar , except:

  1. Add requests_monitor to your INSTALLED_APPS before debug_toolbar:

    INSTALLED_APPS = (
        ...
        'requests_monitor',
        'debug_toolbar',
        ...
    )
  2. And replace debug_toolbar.middleware.DebugToolbarMiddleware to requests_monitor.middleware.RequestMonitorMiddleware.

Configuration

Requests Monitor configurated via dictionary REQUESTS_MONITOR_CONFIG:

  • STORAGE

    Temponary dara storage, right now supported redis and builtin storage (unstable)

    Redis example:

    redis://127.0.0.1:6379
  • TIMEOUT

    Storage time in seconds, must be Int.

  • PREFIX

    Path to requests monitor page.

  • FILTERS

    List every item is (Class, args, kwargs). Args and kwargs will be transferred to Class on since initialization. Class must have 2 functions:

    • process_request(request)
    • process_response(request, response)

    If function return False, request will not be saved.

Default configuration:

REQUESTS_MONITOR_CONFIG = {
    'STORAGE': 'redis://127.0.0.1:6379',
    'TIMEOUT': 300,
    'PREFIX':  '/requests/',
    'FILTERS': (),
}

Example configuration

REQUESTS_MONITOR_CONFIG = {
    'STORAGE': 'redis://127.0.0.1:6379',
    'TIMEOUT': 100,
    'PREFIX':  '/requests/',
    'FILTERS': (
        ('requests_monitor.filters.AjaxOnlyFilter'),
        ('requests_monitor.filters.DisallowUrlFilter', (re.compile('^/favicon.ico$'),)),
    ),
}

About

As django-debug-toolbar, only with all requests, and ajax too

Resources

License

Stars

Watchers

Forks

Packages

No packages published