Registry / web-framework / pyramid-debugtoolbar

pyramid-debugtoolbar

JSON →
library4.12.1pypypi✓ verified 26d ago

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.

pip install pyramid-debugtoolbar
INSTALL
IMPORT
SIG · PYRAMID-DEBUGTOOLB
P
pyramid-debugtoolbar
web-frameworkpythonv4.12.1
Install
3.7s avg
Import
Disk
38MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.12.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 34.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.000s · 35MB
38MB installed
● package 38MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pyramid_debugtoolbar
config.include('pyramid_debugtoolbar')
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.

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()
Debug
Known issues
breakingOlder 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.
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'`).
affects: <1.0.8
breakingThe debug toolbar should NEVER be enabled in a production environment. It allows arbitrary code execution from semi-trusted sources, posing a severe security risk.
fix
Ensure `pyramid_debugtoolbar` is only included or activated in development/staging environments, typically by managing `pyramid.includes` in environment-specific `.ini` files.
affects: All versions
gotchaThe 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.
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.
affects: All versions
gotchaWhen 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.
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.
affects: All versions
Upgrade
Version history
4.12.1latest on PyPI · released Feb 5, 2024
Audit
Dependencies
pyramidrequiredpyramid_debugtoolbar is an add-on for the Pyramid web framework.
Agent activity
22 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pyramid-debugtoolbar — pip install pyramid-debugtoolbar · libregistry