Code Monkey home page Code Monkey logo

django-debug-toolbar's Introduction

Django Debug Toolbar

This is a fork of Rob Hudson's Debug Toolbar. It includes an alternative style, performance optimizations, and some panels which may not be available in the main repository.

The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/response. It is a small toolbar that, when activated, situates itself in the top-right location of the browser window. When particular panels are clicked, more details about that panel's content are displayed.

Currently, the following panels have been written and are working:

  • Detailed SQL queries
  • Request timer
  • Common HTTP headers
  • Cache statistics
  • HTTP variables
  • Settings variables
  • Profile module
  • Templates rendered
  • Logging message output

If you have ideas for other panels please let us know.

Installation

  1. Add the debug_toolbar directory to your Python path.

  2. Add the following middleware to your project's settings.py file:

    'debug_toolbar.middleware.DebugToolbarMiddleware',

    Tying into middleware allows each panel to be instantiated on request and rendering to happen on response.

  3. Add debug_toolbar to your INSTALLED_APPS setting so Django can find the the template files associated with the Debug Toolbar.

  4. Add your IP address to INTERNAL_IPS or login with a user who is flagged as is_superuser

  5. (Optional) Add a tuple called DEBUG_TOOLBAR_PANELS to your settings.py file that specifies the full Python path to the panel that you want included in the Toolbar. This setting looks very much like the MIDDLEWARE_CLASSES setting. For example:

    # This example is all working panels, not all are active with default settings
    DEBUG_TOOLBAR_PANELS = (
        'debug_toolbar.panels.sql.SQLDebugPanel',
        'debug_toolbar.panels.headers.HeaderDebugPanel',
        'debug_toolbar.panels.cache.CacheDebugPanel',
        'debug_toolbar.panels.profiler.ProfilerDebugPanel',
        'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
            'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
        'debug_toolbar.panels.templates.TemplatesDebugPanel',
        # If you are using the profiler panel you don't need the timer
        # 'debug_toolbar.panels.timer.TimerDebugPanel',
    )
    

    You can change the ordering of this tuple to customize the order of the panels you want to display.

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.