Giter VIP home page Giter VIP logo

django-debug-toolbar-request-history's Introduction

Request History Panel for Django Debug Toolbar

Adds a request history panel to Django Debug Toolbar for viewing stats for different requests (with the option for ajax support).

Install

pip install django-debug-toolbar-request-history

or for development version:

pip install git+https://github.com/djsutho/django-debug-toolbar-request-history.git

Add the panel to DEBUG_TOOLBAR_PANELS (see the config section for more details).

Usage

Click on the "Request History" panel in the toolbar to load the available requests. Click on the request you are interested in (on the "Time" or "Path" part of the request) to load the toolbar for that request.

Note: currently requests do not survive server reload, therefore, when using the dev server old requests will not be available after a code change is loaded.

Config (in settings.py)

To DEBUG_TOOLBAR_PANELS add 'ddt_request_history.panels.request_history.RequestHistoryPanel' e.g.:

DEBUG_TOOLBAR_PANELS = [
    'ddt_request_history.panels.request_history.RequestHistoryPanel',  # Here it is 
    'debug_toolbar.panels.versions.VersionsPanel',
    'debug_toolbar.panels.timer.TimerPanel',
    'debug_toolbar.panels.settings.SettingsPanel',
    'debug_toolbar.panels.headers.HeadersPanel',
    'debug_toolbar.panels.request.RequestPanel',
    'debug_toolbar.panels.sql.SQLPanel',
    'debug_toolbar.panels.templates.TemplatesPanel',
    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
    'debug_toolbar.panels.cache.CachePanel',
    'debug_toolbar.panels.signals.SignalsPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.redirects.RedirectsPanel',
    'debug_toolbar.panels.profiling.ProfilingPanel',
]

For vesions of the debug toolbar less than 1.8 you can record ajax requests by adding SHOW_TOOLBAR_CALLBACK to DEBUG_TOOLBAR_CONFIG e.g.:

DEBUG_TOOLBAR_CONFIG = {
    # only requred for debug_toolbar versions below 1.8
    'SHOW_TOOLBAR_CALLBACK': 'ddt_request_history.panels.request_history.allow_ajax',
}

To change the number of stored requests add RESULTS_STORE_SIZE to DEBUG_TOOLBAR_CONFIG e.g.:

DEBUG_TOOLBAR_CONFIG = {
    'RESULTS_STORE_SIZE': 100,
}

TODO

  • Clean-up
  • Change the storage to survive server reloads (maybe use cache or session).

django-debug-toolbar-request-history's People

Contributors

djsutho avatar gilpinheiro avatar jlubcke avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.