Pyramid Debugtoolbar

4.12.1 · active · verified Sat Apr 11

Pyramid Debugtoolbar is a package that provides an interactive HTML debugger for Pyramid application development. It offers various panels to inspect requests, responses, SQL queries, templates, and more, significantly aiding in development and debugging. The library is actively maintained, with its latest version 4.12.1 released in February 2024.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to integrate `pyramid_debugtoolbar` into a minimal Pyramid application. The toolbar is enabled by calling `config.include('pyramid_debugtoolbar')` during application setup. Once running, visit `http://localhost:6543` and click the Pyramid logo in the upper right to access debugging information. Alternatively, you can activate it by adding `pyramid_debugtoolbar` to the `pyramid.includes` setting in your application's `.ini` file.

from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response

def hello_world(request):
    return Response('Hello, Debugtoolbar!')

if __name__ == '__main__':
    with Configurator() as config:
        # Include the debug toolbar
        config.include('pyramid_debugtoolbar')

        config.add_route('home', '/')
        config.add_view(hello_world, route_name='home')

        app = config.make_wsgi_app()

    server = make_server('0.0.0.0', 6543, app)
    print('Serving on http://localhost:6543 (debug toolbar enabled)')
    server.serve_forever()

view raw JSON →