Skip to main content

A collection of extra panels from Flask-DebugToolbar

Project description

flask-debugtoolbar-extrapanels

A collection of extra panels for Flask-DebugToolbar.

Panels

SignalsPanel

Displays all Blinker signals fired during a request, including the built-in Flask signals and any custom signals you register.

The panel shows:

  • Signal name
  • Sender
  • Keyword arguments
  • Time fired

Built-in Flask signals tracked automatically:

  • request_started
  • request_finished
  • request_tearing_down
  • got_request_exception
  • template_rendered
  • before_render_template
  • appcontext_pushed
  • appcontext_popped
  • appcontext_tearing_down
  • message_flashed

Installation

pip install flask-debugtoolbar-extrapanels

Or with uv:

uv add flask-debugtoolbar-extrapanels

Requirements

  • Python >= 3.10
  • flask-debugtoolbar >= 0.16.0

Usage

Add flask_debugtoolbar_extrapanels.SignalsPanel to the DEBUG_TB_PANELS list in your Flask app config:

from flask import Flask
from flask_debugtoolbar import DebugToolbarExtension

app = Flask(__name__)
app.config["SECRET_KEY"] = "dev-secret-key"
app.config["DEBUG"] = True
app.config["DEBUG_TB_ENABLED"] = True
app.config["DEBUG_TB_PANELS"] = [
    "flask_debugtoolbar.panels.versions.VersionDebugPanel",
    "flask_debugtoolbar.panels.timer.TimerDebugPanel",
    "flask_debugtoolbar.panels.headers.HeaderDebugPanel",
    "flask_debugtoolbar.panels.request_vars.RequestVarsDebugPanel",
    "flask_debugtoolbar.panels.config_vars.ConfigVarsDebugPanel",
    "flask_debugtoolbar.panels.template.TemplateDebugPanel",
    "flask_debugtoolbar.panels.logger.LoggingPanel",
    "flask_debugtoolbar.panels.route_list.RouteListDebugPanel",
    "flask_debugtoolbar_extrapanels.SignalsPanel",
]

toolbar = DebugToolbarExtension(app)

Watching custom signals

Use SignalsPanel.watch() to register any Blinker NamedSignal before the first request:

from blinker import signal
from flask_debugtoolbar_extrapanels import SignalsPanel

my_signal = signal("my-custom-signal")
SignalsPanel.watch("my_custom_signal", my_signal)

After registration, every time my_signal fires during a request it will appear in the Signals panel.

Running the example app

git clone https://github.com/mariofix/flask-debugtoolbar-extrapanels.git
cd flask-debugtoolbar-extrapanels
pip install flask-debugtoolbar
pip install -e .
python example_app.py

Open http://localhost:5000/ in your browser. The debug toolbar will appear with a Signals tab.

  • Visit /flash to trigger message_flashed
  • Visit /custom to trigger a custom Blinker signal

Development

Setup

git clone https://github.com/mariofix/flask-debugtoolbar-extrapanels.git
cd flask-debugtoolbar-extrapanels
uv sync --group dev

Running tests

uv run pytest

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_debugtoolbar_extrapanels-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file flask_debugtoolbar_extrapanels-0.1.0.tar.gz.

File metadata

  • Download URL: flask_debugtoolbar_extrapanels-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.10.6 Linux/6.8.0-101-generic

File hashes

Hashes for flask_debugtoolbar_extrapanels-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35e9d8c97e2ce19393b66dedabde9cc64d78f7046e64a6c79cf28484fd7c1eff
MD5 9c30ea5fa4172fc46743420e6fa17a80
BLAKE2b-256 35e7e6a8d8adab0be5588dd7f49a664f55dc6629366d12cbeb50e9a08b654eab

See more details on using hashes here.

File details

Details for the file flask_debugtoolbar_extrapanels-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_debugtoolbar_extrapanels-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ca8114cdd8ffd20894cc112975befabd0cdef76ae5a135f6171f5d9eb1aa826
MD5 eb2e3835eb9ec5ea2efc7d1a66148c46
BLAKE2b-256 9d0b90b10e2f827195fc9f2eabfa40ac4c688a6e6bc1ccfa7761f820793c3862

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page