{"id":3234,"library":"pyramid-debugtoolbar","title":"Pyramid Debugtoolbar","description":"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.","status":"active","version":"4.12.1","language":"en","source_language":"en","source_url":"https://github.com/Pylons/pyramid_debugtoolbar","tags":["pyramid","debug","profiling","web development","development tools"],"install":[{"cmd":"pip install pyramid-debugtoolbar","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"pyramid_debugtoolbar is an add-on for the Pyramid web framework.","package":"pyramid","optional":false}],"imports":[{"note":"The primary way to enable the toolbar is by including it in your Pyramid application's configuration, not a direct Python import for runtime use.","symbol":"pyramid_debugtoolbar","correct":"config.include('pyramid_debugtoolbar')"}],"quickstart":{"code":"from wsgiref.simple_server import make_server\nfrom pyramid.config import Configurator\nfrom pyramid.response import Response\n\ndef hello_world(request):\n    return Response('Hello, Debugtoolbar!')\n\nif __name__ == '__main__':\n    with Configurator() as config:\n        # Include the debug toolbar\n        config.include('pyramid_debugtoolbar')\n\n        config.add_route('home', '/')\n        config.add_view(hello_world, route_name='home')\n\n        app = config.make_wsgi_app()\n\n    server = make_server('0.0.0.0', 6543, app)\n    print('Serving on http://localhost:6543 (debug toolbar enabled)')\n    server.serve_forever()","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade `pyramid_debugtoolbar` to version 1.0.8 or later when using Pyramid 1.5a2+ (e.g., `pip install 'pyramid_debugtoolbar>=1.0.8'`).","message":"Older versions of `pyramid_debugtoolbar` (prior to 1.0.8) are not compatible with Pyramid versions 1.5a2 and newer, due to changes in Pyramid's core. Ensure you upgrade `pyramid_debugtoolbar` if you are using a newer Pyramid version.","severity":"breaking","affected_versions":"<1.0.8"},{"fix":"Ensure `pyramid_debugtoolbar` is only included or activated in development/staging environments, typically by managing `pyramid.includes` in environment-specific `.ini` files.","message":"The debug toolbar should NEVER be enabled in a production environment. It allows arbitrary code execution from semi-trusted sources, posing a severe security risk.","severity":"breaking","affected_versions":"All versions"},{"fix":"Consider disabling the toolbar or specific panels for memory-intensive operations. The `debugtoolbar.exclude_routes` or `debugtoolbar.exclude_prefixes` settings can prevent data collection for certain paths.","message":"The toolbar can consume significant memory, especially during long-running tasks, as it captures a large amount of application state for introspection. This can lead to high memory usage or Out-Of-Memory (OOM) errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"You may need to explicitly configure `request.static_url` in your application to force HTTPS, or ensure your proxy/load balancer correctly rewrites schemes for static assets. A workaround involves patching `URLMethodsMixin.static_url` to inject `_scheme='https'` for all static URLs.","message":"When running a Pyramid application over HTTPS, `pyramid_debugtoolbar` might generate HTTP links for its static assets (CSS, JavaScript), leading to mixed content warnings in browsers and potentially broken toolbar functionality.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}