Releases: django-commons/django-debug-toolbar
6.0.0
Description
The v6.0.0 release of Django Debug Toolbar significantly revamps how panels for the toolbar work. Each panel will now persist its data in a store. A store can either be backed by various backends. The toolbar will support a memory and database backend to start.
The toolbar is now using Django's SafeExceptionReporterFilter.cleanse_setting()
function to filter out sensitive information. Some data will be replaced with "********************"
. This is because the toolbar could be configured to write the request information to a persistent store such as a cache or database.
Django applications with basic installations are backwards compatible with this change. If there are hooks into the internals of the toolbar, such as DebugToolbar.store_id
then it will be backwards incompatible.
Third-party panels will need updating. Any data that is stored in record_stats
will need to be fetched back out from self.get_stats()
before being able to be rendered. This is to support loading an instance of the toolbar from persisted data. A simple example of this transition can be found in debug_toolbar/panels/cache.py
in PR 2138
How to upgrade
- Changes required if the toolbar isn't installed entirely programmatically
- If you experience
RuntimeError: Model class debug_toolbar.models.HistoryEntry doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
, you need to remove the reference to the toolbar's urls in yoururls.py
file andMIDDLEWARE
setting when the toolbar isn't inINSTALLED_APPS
- If you experience
- If you have a custom panel, you'll need to adjust
record_stats
and useself.get_stats()
to fetch data for rendering - If you'd like to use the database store, see
TOOLBAR_STORE_CLASS
for more info
Why did the internals change?
The Django Debug Toolbar is a popular package we did not want to block the community from pursuing the async path for Django applications. Writing the request data to a store better positions the toolbar for async projects. It also opens the door for it being usable in production as well with API integrations.
What's Changed
- Log serialization warning when a panel errors. by @tim-schilling in #1810
- Improve clarity of record_stats for serialization. by @tim-schilling in #1965
- Update serializable branch with main by @tim-schilling in #2072
- Remove pin for django-csp. by @tim-schilling in #2132
- Fixes #2073 -- Added DatabaseStore for persistent debug data storage. by @dr-rompecabezas in #2121
- Disabled document.cookie linter by @tim-schilling in #2139
- Added check for pytest as test runner for IS_RUNNING_TESTS. by @tim-schilling in #2137
- Remove Type Hints from CspRenderingTestCase by @andoriyaprashant in #2144
- Add show_toolbar_with_docker function for Docker IP handling by @matthiask in #2153
- Support serializable toolbar by @tim-schilling in #2138
- Deduplicate staticfiles by @matthiask in #2155
- Fixes #2158 -- Made static file objects orderable by @matthiask in #2161
- Fixes #2160 -- Corrected links to static files by @matthiask in #2162
- Fixes #2151 -- Forwarded args and kwargs in URLMixin.url by @matthiask in #2163
- Fixes #2159 -- Do not HTML-escape traces in the cache and profiling panel by @matthiask in #2164
Full Changelog: 5.2.0...6.0.0
Acknowlegements
Thank you to all the contributors who made this release possible. Thank you to @robhudson, @matthiask, @tim-schilling, @salty-ivy and @dr-rompecabezas for their support, development and reviews of the serializable toolbar changes. A special shout-out to @matthiask for leading the Djangonaut Space Session 4 team of @dr-rompecabezas, @andoriyaprashant and @blingblin-g.
5.2.0
What's Changed
- Enhance RedirectsPanel with customizable redirect response hook by @blingblin-g in #2104
- Sanitize sensitive variables in RequestPanel by @dr-rompecabezas in #2105
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2112
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2115
- Dark Mode Conflict in Pygments Fixed by @andoriyaprashant in #2111
- Fix #2109: Recursively unwrap loaders to support template partials by @matthiask in #2117
- Refs #2096: The theme selector now controls all colors by @matthiask in #2116
- Format the templates using djade by @matthiask in #2120
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2122
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2126
- Keep pannel close button accessible with external styles by @TomHall2020 in #2128
- Add CSS resets for height and min-height by @matthiask in #2130
New Contributors
- @TomHall2020 made their first contribution in #2128
Full Changelog: 5.1.0...5.2.0
5.1.0
What's Changed
- Update version for sigstore action to full version. by @tim-schilling in #2056
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2053
- Add Django 5.2 to tox matrix by @tim-schilling in #2064
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2063
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2067
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2077
- Update package metadata to include well-known labels by @andoriyaprashant in #2078
- Pinned django-csp's version used for our tests by @matthiask in #2084
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2080
- Add resources section to the documentation by @dr-rompecabezas in #2081
- Make show toolbar callback function async/sync compatible. by @tim-schilling in #2066
- Fix last name typo in resources.rst by @dr-rompecabezas in #2085
- Add link to contributing documentation in CONTRIBUTING.md by @blingblin-g in #2086
- Pull translations from transifex by @matthiask in #2089
- Replace ESLint and prettier with biome by @matthiask in #2090
- Enable a few of the disabled biome rules by @matthiask in #2091
- Replace forEach loops with for...of loops by @matthiask in #2093
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2095
- Add help command to the Makefile by @mrbazzan in #2094
- Replace DebugConfiguredStorage with URLMixin in staticfiles panel by @dr-rompecabezas in #2097
- Fix for exception-unhandled "forked" Promise chain by @karolyi in #2101
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2102
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #2107
- Fix Dark Mode Conflict in Pygments by @andoriyaprashant in #2108
- Refactor on csp_nonce usage with django-csp by @tim-schilling in #2088
New Contributors
- @andoriyaprashant made their first contribution in #2078
- @dr-rompecabezas made their first contribution in #2081
- @blingblin-g made their first contribution in #2086
- @mrbazzan made their first contribution in #2094
Full Changelog: 5.0.1...5.1.0
5.0.1
What's Changed
There were no functional changes in this version.
PRs
- Update release workflows to latest trusted publisher GHA. by @tim-schilling in #2054
Full Changelog: 5.0.0...5.0.1
5.0.0
What's Changed
Please note that Django Debug Toolbar has now moved into the Django Commons organization.
Changelog
- Added Python 3.13 to the CI matrix.
- Removed support for Python 3.8 as it has reached end of life.
- Converted to Django Commons PyPI release process.
- Fixed a crash which occurred when using non-
str
static file values. - Documented experimental async support.
- Improved troubleshooting doc for incorrect mime types for .js static files
- Support async applications and ASGI from
Google Summer of Code Project 2024 <https://summerofcode.withgoogle.com/programs/2024/projects/iXVvyGYp>
__. - Added Django 5.1 to the CI matrix.
- Added support for the
LoginRequiredMiddleware
introduced in Django 5.1. - Support select and explain buttons for
UNION
queries on PostgreSQL. - Fixed internal toolbar requests being instrumented if the Django setting
FORCE_SCRIPT_NAME
was set. - Increase opacity of show Debug Toolbar handle to improve accessibility.
- Changed the
RedirectsPanel
to be async compatible. - Increased the contrast of text with dark mode enabled.
- Add translations for Bulgarian and Korean.
- Update translations for several languages.
- Include new translatable strings for translation.
- Fixed a crash which happened in the fallback case when session keys cannot be
sorted.
PRs
- Async compatible debug-toolbar middleware by @salty-ivy in #1938
- Add async tests by @salomvary in #1835
- Update installation.rst by @Dr-Bernard in #1967
- Make toolbar compatible with
FORCE_SCRIPT_NAME
by @dmartin in #1970 - Support select and explain for UNION queries by @friedelwolff in #1972
- Override
DEBUG=True
in async middleware compatibility tests by @salty-ivy in #1977 - Quick hack for including csp_nonces from requests into script tags by @karolyi in #1975
- Slightly increase opacity of debug toolbar button by @jribbens in #1982
- Async compatible redirect panel by @salty-ivy in #1976
- 🔧 update translation for Persian language by @elias-ebrahimpour in #1873
- Add a paragraph describing our stance on Python typing by @matthiask in #1979
- Dark mode text needs higher contrast by @myou1985 in #1987
- Switch to Django Commons code of conduct by @tim-schilling in #1978
- Update translations by @tim-schilling in #1984
- Make Panels non async by default by @salty-ivy in #1990
- Async compatible
StaticFilesPanel
by @salty-ivy in #1983 - Refs #1668: Fixed the unsortable session keys fallback by @matthiask in #1994
- Add Django 5.1 to the CI matrix by @matthiask in #1995
- Use Heading-4 for PR template for screen-readers. by @tim-schilling in #1999
- Async compatible
HistoryPanel
by @salty-ivy in #1991 - Async compatible
SQLPanel
by @salty-ivy in #1993 - Correct "middleware" typos by @korverdev in #2003
- add support for LoginRequiredMiddleware with login_not_required decor… by @dulmandakh in #2005
- Async integration tests by @salty-ivy in #2001
- Modernize Python type hints and string formatting by @cclauss in #2012
- Adding in support for Python 3.13 by @abeed-avayu in #2014
- Fix #2011: Test the divisor, not the dividend for zero by @matthiask in #2015
- Update Installation warning doc by @salty-ivy in #2019
- Convert to Django Commons pypi-github release process by @tim-schilling in #2017
- The static files panel shouldn't choke on unexpected data types by @matthiask in #2021
- Update references to point to django-commons repo by @robhudson in #2022
- Update pyupgrade's target version to Python 3.9 by @ulgens in #2024
- I added more explanations to the example/readme file. by @jong-seoung in #2027
- Adopt a basic security policy by @tim-schilling in #2040
- Fix whitespace view in code by @thesayfulla in #2043
- Documented experimental async support. by @tim-schilling in #2045
- Updated Troubleshooting documentation: simpler mimetype workaround for .js file by @blep in #2047
Google Summer of Code - Async project
This release contains the changes for async compatibility for the majority of panels. This is the result of the Google Summer of Code project by @salty-ivy. A massive thank you 💚 and a round of applause 👏 is due to Aman!
New Contributors
- @Dr-Bernard made their first contribution in #1967
- @dmartin made their first contribution in #1970
- @friedelwolff made their first contribution in #1972
- @karolyi made their first contribution in #1975
- @jribbens made their first contribution in #1982
- @elias-ebrahimpour made their first contribution in #1873
- @myou1985 made their first contribution in #1987
- @korverdev made their first contribution in #2003
- @dulmandakh made their first contribution in #2005
- @abeed-avayu made their first contribution in #2014
- @robhudson made their first contribution in #2022
- @ulgens made their first contribution in #2024
- @jong-seoung made their first contribution in #2027
- @thesayfulla made their first contribution in #2043
- @blep made their first contribution in #2047
Full Changelog: 4.4.6...5.0.0
5.0.0-alpha
Why 5.0 and why alpha?
Version 5.0 does not contain any backwards incompatible changes. Instead it should be more compatible with async Django projects. However, the change did require some reasonably sized changes to the middleware. This is a large enough change that we wanted it to be effectively communicated to users of the toolbar.
This release is an alpha because the async logic was tested, but we also understand that we haven't tested it in every scenario. We fully expect the project to continue to function extremely well in WSGI applications. For ASGI applications that are utilizing async, well, that's why it's an alpha 😁
What's Changed
- Async compatible debug-toolbar middleware by @salty-ivy in #1938
- Add async tests by @salomvary in #1835
- Update installation.rst by @Dr-Bernard in #1967
- Make toolbar compatible with
FORCE_SCRIPT_NAME
by @dmartin in #1970 - Support select and explain for UNION queries by @friedelwolff in #1972
- Override
DEBUG=True
in async middleware compatibility tests by @salty-ivy in #1977 - Quick hack for including csp_nonces from requests into script tags by @karolyi in #1975
- Slightly increase opacity of debug toolbar button by @jribbens in #1982
- Async compatible redirect panel by @salty-ivy in #1976
- 🔧 update translation for Persian language by @elias-ebrahimpour in #1873
- Add a paragraph describing our stance on Python typing by @matthiask in #1979
- Dark mode text needs higher contrast by @myou1985 in #1987
- Switch to Django Commons code of conduct by @tim-schilling in #1978
- Update translations by @tim-schilling in #1984
- Make Panels non async by default by @salty-ivy in #1990
- Async compatible
StaticFilesPanel
by @salty-ivy in #1983 - Refs #1668: Fixed the unsortable session keys fallback by @matthiask in #1994
- Add Django 5.1 to the CI matrix by @matthiask in #1995
- Use Heading-4 for PR template for screen-readers. by @tim-schilling in #1999
- Async compatible
HistoryPanel
by @salty-ivy in #1991 - Async compatible
SQLPanel
by @salty-ivy in #1993
New Contributors
- @Dr-Bernard made their first contribution in #1967
- @dmartin made their first contribution in #1970
- @friedelwolff made their first contribution in #1972
- @karolyi made their first contribution in #1975
- @jribbens made their first contribution in #1982
- @elias-ebrahimpour made their first contribution in #1873
- @myou1985 made their first contribution in #1987
Google Summer of Code - Async project
This release contains the changes for async compatibility for the majority of panels. This is the result of the Google Summer of Code project by @salty-ivy. A massive thank you 💚 and a round of applause 👏 is due to Aman!
Full Changelog: 4.4.6...5.0.0-alpha
4.4.6
What's Changed
- Close #1509: Revert the infinite recursion fix, Django has changed the behavior by @matthiask in #1955
- Fixed order and grammatical number of panels in documentation by @bkdekoning in #1956
- Alerts panel: Only process HTML responses by @matthiask in #1960
Full Changelog: 4.4.5...4.4.6
4.4.5
What's Changed
- Fix #1951: Do not crash if the 'alerts' key doesn't exist by @matthiask in #1953
- Only import the jinja2 instrumentation when jinja2 itself is importable by @matthiask in #1954
Full Changelog: 4.4.4...4.4.5
4.4.4
What's Changed
- Check for for StreamingHttpResponse when generating stats in Alert by @danjac in #1946
- Actually use the Jinja2 template backend by @matthiask in #1882
New Contributors
Full Changelog: 4.4.3...4.4.4
4.4.3
What's Changed
- Fix overriding font-family for both light and dark themes by @federicobond in #1930
- Restore compatibility with iptools.IpRangeList by @quinox in #1929
- Limit the cases for E001 to likely scenarios by @tim-schilling in #1925
- Introduce debug_toolbar_urls to simplify installation by @tim-schilling in #1926
- Fixed #1682 -- alert user when using file field without proper encoding by @bkdekoning in #1933
- Remove rem units from svg by @michjnich in #1942
New Contributors
- @quinox made their first contribution in #1929
- @bkdekoning made their first contribution in #1933
- @michjnich made their first contribution in #1942
Full Changelog: 4.4.2...4.4.3