{"id":3495,"library":"flask-debugtoolbar","title":"Flask Debug Toolbar","description":"Flask-DebugToolbar is a Flask extension that provides a customizable toolbar overlay for debugging web applications. It's an active project within the Pallets Community Ecosystem, currently at version 0.16.0, and releases updates periodically to maintain compatibility with Flask and Python.","status":"active","version":"0.16.0","language":"en","source_language":"en","source_url":"https://github.com/pallets-eco/flask-debugtoolbar/","tags":["flask","debugging","web development","toolbar","pallets"],"install":[{"cmd":"pip install flask-debugtoolbar","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core web framework dependency.","package":"Flask","version":">=2.3.0"},{"reason":"Required for package metadata parsing (added post 0.14.0).","package":"packaging","version":">=21.3"},{"reason":"Optional: Required for the SQLAlchemy debug panel to show queries.","package":"Flask-SQLAlchemy","optional":true},{"reason":"Optional: Required for SQL syntax highlighting in the SQLAlchemy debug panel.","package":"Pygments","optional":true}],"imports":[{"symbol":"DebugToolbarExtension","correct":"from flask_debugtoolbar import DebugToolbarExtension"}],"quickstart":{"code":"from flask import Flask, render_template\nfrom flask_debugtoolbar import DebugToolbarExtension\nimport os\n\napp = Flask(__name__)\napp.debug = True  # Enable debug mode\napp.config['SECRET_KEY'] = os.environ.get('FLASK_SECRET_KEY', 'a_very_secret_key_for_dev')\n\n# Optional: Configure toolbar settings\n# app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False\n\ntoolbar = DebugToolbarExtension(app)\n\n@app.route('/')\ndef index():\n    return '<body><h1>Hello, Flask!</h1></body>'\n\n@app.route('/hello/<name>')\ndef hello(name):\n    return render_template('hello.html', name=name) # Ensure templates are in 'templates/' folder\n\n# Example of running the app\n# if __name__ == '__main__':\n#     # You would typically run with 'flask run --debug' or a WSGI server\n#     # For this quickstart, ensure FLASK_APP is set to your app file (e.g., 'app.py')\n#     # and then run 'flask run --debug'\n#     pass\n","lang":"python","description":"To enable the Flask Debug Toolbar, initialize it with your Flask application. Crucially, set `app.debug = True` and configure a `SECRET_KEY` in `app.config`. The toolbar is automatically injected into HTML responses when debug mode is active. For full functionality, ensure your responses contain a `<body>` tag. Using `render_template` is recommended."},"warnings":[{"fix":"Upgrade your Python environment to 3.8 or a later version.","message":"Version 0.16.0 drops support for Python 3.7. Applications running on Python 3.7 will need to upgrade their Python version to 3.8 or newer to use Flask-DebugToolbar 0.16.0 and above.","severity":"breaking","affected_versions":">=0.16.0"},{"fix":"Ensure your Flask application is running Flask 2.3.0 or newer. For Flask 2.2.x, use Flask-DebugToolbar 0.15.x.","message":"Version 0.16.0 requires Flask version 2.3.0 or higher. Older Flask versions are incompatible.","severity":"breaking","affected_versions":">=0.16.0"},{"fix":"Do not use version 0.14.0; upgrade directly to 0.14.1 or newer.","message":"Version 0.14.0 was released with a missing `packaging` dependency, causing an `ImportError`. This was fixed in 0.14.1.","severity":"gotcha","affected_versions":"0.14.0"},{"fix":"Avoid direct access to `flask_debugtoolbar.__version__`. Instead, rely on package management tools or `importlib.metadata` to query the installed version if programmatic access is needed.","message":"The `__version__` attribute has been removed from the library as of 0.16.0.","severity":"deprecated","affected_versions":">=0.16.0"},{"fix":"Set `app.debug = True` and `app.config['SECRET_KEY'] = 'your_secret_key'` (use an environment variable for production) before `toolbar = DebugToolbarExtension(app)`.","message":"The Debug Toolbar will only be displayed if `app.debug = True` is set and a `SECRET_KEY` is configured in `app.config`. Ensure `app.debug = True` is set *before* initializing `DebugToolbarExtension`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Flask view functions return HTML that includes a `<body>` tag, typically by using `render_template`.","message":"The toolbar requires a `<body>` tag in the HTML response to inject its content. It may not appear on pages returning plain strings or non-HTML content.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review custom integrations that might have implicitly relied on `Blinker` being present as a `flask-debugtoolbar` dependency. Most users will not be affected.","message":"The `Blinker` dependency was dropped in 0.16.0. If you have custom extensions or code relying on `Blinker` signals specifically related to the debug toolbar, this change might affect you, though it's generally an internal dependency removal.","severity":"gotcha","affected_versions":">=0.16.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}