django-debug-toolbar 4.4.2__tar.gz → 4.4.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.gitignore +2 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.pre-commit-config.yaml +3 -3
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/PKG-INFO +2 -2
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/README.rst +1 -1
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/__init__.py +1 -1
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/apps.py +30 -2
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/middleware.py +12 -3
- django_debug_toolbar-4.4.4/debug_toolbar/panels/alerts.py +152 -0
- django_debug_toolbar-4.4.4/debug_toolbar/panels/templates/jinja2.py +23 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/templates/panel.py +2 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/settings.py +1 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/static/debug_toolbar/css/toolbar.css +6 -2
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/includes/theme_selector.html +0 -6
- django_debug_toolbar-4.4.4/debug_toolbar/templates/debug_toolbar/panels/alerts.html +12 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/toolbar.py +27 -1
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/changes.rst +22 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/conf.py +1 -1
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/configuration.rst +11 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/installation.rst +9 -7
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/panels.rst +11 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/settings.py +7 -1
- django_debug_toolbar-4.4.4/example/templates/bad_form.html +14 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/templates/index.html +2 -0
- django_debug_toolbar-4.4.4/example/templates/jinja2/index.jinja +12 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/urls.py +10 -9
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/views.py +5 -0
- django_debug_toolbar-4.4.4/tests/panels/test_alerts.py +112 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_history.py +1 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_template.py +16 -1
- django_debug_toolbar-4.4.4/tests/templates/jinja2/base.html +9 -0
- django_debug_toolbar-4.4.4/tests/templates/jinja2/basic.jinja +5 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/test_checks.py +65 -34
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/test_integration.py +26 -3
- django_debug_toolbar-4.4.4/tests/test_toolbar.py +17 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/views.py +1 -1
- django_debug_toolbar-4.4.2/tests/templates/jinja2/basic.jinja +0 -2
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.editorconfig +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.github/dependabot.yml +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.github/workflows/coverage.yml +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.github/workflows/release.yml +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.github/workflows/test.yml +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.readthedocs.yaml +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/.tx/config +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/CODE_OF_CONDUCT.md +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/CONTRIBUTING.md +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/LICENSE +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/Makefile +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/_stubs.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/decorators.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/forms.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/ca/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/ca/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/cs/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/cs/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/de/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/de/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/en/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/en/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/es/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/es/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/fa/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/fa/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/fi/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/fi/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/fr/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/fr/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/he/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/he/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/id/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/id/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/it/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/it/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/ja/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/ja/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/nl/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/nl/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/pl/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/pl/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/pt/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/pt/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/ru/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/ru/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/sk/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/sk/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/uk/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/uk/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.mo +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.po +0 -0
- {django_debug_toolbar-4.4.2/tests/panels → django_debug_toolbar-4.4.4/debug_toolbar/management}/__init__.py +0 -0
- {django_debug_toolbar-4.4.2/tests → django_debug_toolbar-4.4.4/debug_toolbar/management}/commands/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/management/commands/debugsqlshell.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/cache.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/headers.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/history/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/history/forms.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/history/panel.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/history/views.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/profiling.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/redirects.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/request.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/settings.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/signals.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/sql/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/sql/forms.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/sql/panel.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/sql/tracking.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/sql/utils.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/sql/views.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/staticfiles.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/templates/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/templates/views.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/timer.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/versions.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/static/debug_toolbar/css/print.css +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/static/debug_toolbar/js/history.js +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/static/debug_toolbar/js/redirect.js +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/static/debug_toolbar/js/timer.js +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/static/debug_toolbar/js/toolbar.js +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/static/debug_toolbar/js/utils.js +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/base.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/includes/panel_button.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/includes/panel_content.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/cache.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/headers.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/history.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/history_tr.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/profiling.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/request.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/request_variables.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/settings.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/signals.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/sql.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/sql_select.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/staticfiles.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/template_source.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/templates.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/timer.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/panels/versions.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/templates/debug_toolbar/redirect.html +0 -0
- {django_debug_toolbar-4.4.2/tests → django_debug_toolbar-4.4.4/debug_toolbar/templatetags}/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/urls.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/utils.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/views.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/Makefile +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/architecture.rst +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/checks.rst +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/commands.rst +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/contributing.rst +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/index.rst +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/make.bat +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/spelling_wordlist.txt +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/docs/tips.rst +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/eslint.config.js +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/README.rst +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/django-debug-toolbar.png +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/example.db +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/manage.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/screenshot.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/static/test.css +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/templates/htmx/boost.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/templates/jquery/index.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/templates/mootools/index.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/templates/prototype/index.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/templates/turbo/index.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/test_views.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/example/wsgi.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/pyproject.toml +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/requirements_dev.txt +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/setup.py +0 -0
- {django_debug_toolbar-4.4.2/debug_toolbar/templatetags → django_debug_toolbar-4.4.4/tests}/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/additional_static/base.css +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/base.py +0 -0
- {django_debug_toolbar-4.4.2/debug_toolbar/management → django_debug_toolbar-4.4.4/tests}/commands/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/commands/test_debugsqlshell.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/context_processors.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/forms.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/loaders.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/middleware.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/models.py +0 -0
- {django_debug_toolbar-4.4.2/debug_toolbar/management → django_debug_toolbar-4.4.4/tests/panels}/__init__.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_cache.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_custom.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_profiling.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_redirects.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_request.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_settings.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_sql.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_staticfiles.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/panels/test_versions.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/settings.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/sync.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/templates/ajax/ajax.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/templates/base.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/templates/basic.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/templates/registration/login.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/templates/sql/flat.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/templates/sql/included.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/templates/sql/nested.html +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/test_decorators.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/test_forms.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/test_utils.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/urls.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/urls_invalid.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tests/urls_use_package_urls.py +0 -0
- {django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/tox.ini +0 -0
|
@@ -14,7 +14,7 @@ repos:
|
|
|
14
14
|
hooks:
|
|
15
15
|
- id: doc8
|
|
16
16
|
- repo: https://github.com/adamchainz/django-upgrade
|
|
17
|
-
rev: 1.
|
|
17
|
+
rev: 1.19.0
|
|
18
18
|
hooks:
|
|
19
19
|
- id: django-upgrade
|
|
20
20
|
args: [--target-version, "4.2"]
|
|
@@ -32,7 +32,7 @@ repos:
|
|
|
32
32
|
args:
|
|
33
33
|
- --trailing-comma=es5
|
|
34
34
|
- repo: https://github.com/pre-commit/mirrors-eslint
|
|
35
|
-
rev: v9.
|
|
35
|
+
rev: v9.6.0
|
|
36
36
|
hooks:
|
|
37
37
|
- id: eslint
|
|
38
38
|
additional_dependencies:
|
|
@@ -44,7 +44,7 @@ repos:
|
|
|
44
44
|
args:
|
|
45
45
|
- --fix
|
|
46
46
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
47
|
-
rev: 'v0.
|
|
47
|
+
rev: 'v0.5.0'
|
|
48
48
|
hooks:
|
|
49
49
|
- id: ruff
|
|
50
50
|
args: [--fix, --exit-non-zero-on-fix]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: django-debug-toolbar
|
|
3
|
-
Version: 4.4.
|
|
3
|
+
Version: 4.4.4
|
|
4
4
|
Summary: A configurable set of panels that display various debug information about the current request/response.
|
|
5
5
|
Project-URL: Download, https://pypi.org/project/django-debug-toolbar/
|
|
6
6
|
Project-URL: Homepage, https://github.com/jazzband/django-debug-toolbar
|
|
@@ -74,7 +74,7 @@ Here's a screenshot of the toolbar in action:
|
|
|
74
74
|
In addition to the built-in panels, a number of third-party panels are
|
|
75
75
|
contributed by the community.
|
|
76
76
|
|
|
77
|
-
The current stable version of the Debug Toolbar is 4.4.
|
|
77
|
+
The current stable version of the Debug Toolbar is 4.4.4. It works on
|
|
78
78
|
Django ≥ 4.2.0.
|
|
79
79
|
|
|
80
80
|
The Debug Toolbar does not currently support `Django's asynchronous views
|
|
@@ -44,7 +44,7 @@ Here's a screenshot of the toolbar in action:
|
|
|
44
44
|
In addition to the built-in panels, a number of third-party panels are
|
|
45
45
|
contributed by the community.
|
|
46
46
|
|
|
47
|
-
The current stable version of the Debug Toolbar is 4.4.
|
|
47
|
+
The current stable version of the Debug Toolbar is 4.4.4. It works on
|
|
48
48
|
Django ≥ 4.2.0.
|
|
49
49
|
|
|
50
50
|
The Debug Toolbar does not currently support `Django's asynchronous views
|
|
@@ -4,7 +4,7 @@ APP_NAME = "djdt"
|
|
|
4
4
|
|
|
5
5
|
# Do not use pkg_resources to find the version but set it here directly!
|
|
6
6
|
# see issue #1446
|
|
7
|
-
VERSION = "4.4.
|
|
7
|
+
VERSION = "4.4.4"
|
|
8
8
|
|
|
9
9
|
# Code that discovers files or modules in INSTALLED_APPS imports this module.
|
|
10
10
|
urls = "debug_toolbar.urls", APP_NAME
|
|
@@ -5,10 +5,12 @@ from django.apps import AppConfig
|
|
|
5
5
|
from django.conf import settings
|
|
6
6
|
from django.core.checks import Error, Warning, register
|
|
7
7
|
from django.middleware.gzip import GZipMiddleware
|
|
8
|
+
from django.urls import NoReverseMatch, reverse
|
|
8
9
|
from django.utils.module_loading import import_string
|
|
9
10
|
from django.utils.translation import gettext_lazy as _
|
|
10
11
|
|
|
11
|
-
from debug_toolbar import settings as dt_settings
|
|
12
|
+
from debug_toolbar import APP_NAME, settings as dt_settings
|
|
13
|
+
from debug_toolbar.settings import CONFIG_DEFAULTS
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
class DebugToolbarConfig(AppConfig):
|
|
@@ -213,7 +215,33 @@ def debug_toolbar_installed_when_running_tests_check(app_configs, **kwargs):
|
|
|
213
215
|
"""
|
|
214
216
|
Check that the toolbar is not being used when tests are running
|
|
215
217
|
"""
|
|
216
|
-
if
|
|
218
|
+
# Check if show toolbar callback has changed
|
|
219
|
+
show_toolbar_changed = (
|
|
220
|
+
dt_settings.get_config()["SHOW_TOOLBAR_CALLBACK"]
|
|
221
|
+
!= CONFIG_DEFAULTS["SHOW_TOOLBAR_CALLBACK"]
|
|
222
|
+
)
|
|
223
|
+
try:
|
|
224
|
+
# Check if the toolbar's urls are installed
|
|
225
|
+
reverse(f"{APP_NAME}:render_panel")
|
|
226
|
+
toolbar_urls_installed = True
|
|
227
|
+
except NoReverseMatch:
|
|
228
|
+
toolbar_urls_installed = False
|
|
229
|
+
|
|
230
|
+
# If the user is using the default SHOW_TOOLBAR_CALLBACK,
|
|
231
|
+
# then the middleware will respect the change to settings.DEBUG.
|
|
232
|
+
# However, if the user has changed the callback to:
|
|
233
|
+
# DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda request: DEBUG}
|
|
234
|
+
# where DEBUG is not settings.DEBUG, then it won't pick up that Django'
|
|
235
|
+
# test runner has changed the value for settings.DEBUG, and the middleware
|
|
236
|
+
# will inject the toolbar, while the URLs aren't configured leading to a
|
|
237
|
+
# NoReverseMatch error.
|
|
238
|
+
likely_error_setup = show_toolbar_changed and not toolbar_urls_installed
|
|
239
|
+
|
|
240
|
+
if (
|
|
241
|
+
not settings.DEBUG
|
|
242
|
+
and dt_settings.get_config()["IS_RUNNING_TESTS"]
|
|
243
|
+
and likely_error_setup
|
|
244
|
+
):
|
|
217
245
|
return [
|
|
218
246
|
Error(
|
|
219
247
|
"The Django Debug Toolbar can't be used with tests",
|
|
@@ -20,8 +20,14 @@ def show_toolbar(request):
|
|
|
20
20
|
"""
|
|
21
21
|
Default function to determine whether to show the toolbar on a given page.
|
|
22
22
|
"""
|
|
23
|
-
|
|
23
|
+
if not settings.DEBUG:
|
|
24
|
+
return False
|
|
24
25
|
|
|
26
|
+
# Test: settings
|
|
27
|
+
if request.META.get("REMOTE_ADDR") in settings.INTERNAL_IPS:
|
|
28
|
+
return True
|
|
29
|
+
|
|
30
|
+
# Test: Docker
|
|
25
31
|
try:
|
|
26
32
|
# This is a hack for docker installations. It attempts to look
|
|
27
33
|
# up the IP address of the docker host.
|
|
@@ -31,11 +37,14 @@ def show_toolbar(request):
|
|
|
31
37
|
".".join(socket.gethostbyname("host.docker.internal").rsplit(".")[:-1])
|
|
32
38
|
+ ".1"
|
|
33
39
|
)
|
|
34
|
-
|
|
40
|
+
if request.META.get("REMOTE_ADDR") == docker_ip:
|
|
41
|
+
return True
|
|
35
42
|
except socket.gaierror:
|
|
36
43
|
# It's fine if the lookup errored since they may not be using docker
|
|
37
44
|
pass
|
|
38
|
-
|
|
45
|
+
|
|
46
|
+
# No test passed
|
|
47
|
+
return False
|
|
39
48
|
|
|
40
49
|
|
|
41
50
|
@lru_cache(maxsize=None)
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from html.parser import HTMLParser
|
|
2
|
+
|
|
3
|
+
from django.utils.translation import gettext_lazy as _
|
|
4
|
+
|
|
5
|
+
from debug_toolbar.panels import Panel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FormParser(HTMLParser):
|
|
9
|
+
"""
|
|
10
|
+
HTML form parser, used to check for invalid configurations of forms that
|
|
11
|
+
take file inputs.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self):
|
|
15
|
+
super().__init__()
|
|
16
|
+
self.in_form = False
|
|
17
|
+
self.current_form = {}
|
|
18
|
+
self.forms = []
|
|
19
|
+
self.form_ids = []
|
|
20
|
+
self.referenced_file_inputs = []
|
|
21
|
+
|
|
22
|
+
def handle_starttag(self, tag, attrs):
|
|
23
|
+
attrs = dict(attrs)
|
|
24
|
+
if tag == "form":
|
|
25
|
+
self.in_form = True
|
|
26
|
+
form_id = attrs.get("id")
|
|
27
|
+
if form_id:
|
|
28
|
+
self.form_ids.append(form_id)
|
|
29
|
+
self.current_form = {
|
|
30
|
+
"file_form": False,
|
|
31
|
+
"form_attrs": attrs,
|
|
32
|
+
"submit_element_attrs": [],
|
|
33
|
+
}
|
|
34
|
+
elif (
|
|
35
|
+
self.in_form
|
|
36
|
+
and tag == "input"
|
|
37
|
+
and attrs.get("type") == "file"
|
|
38
|
+
and (not attrs.get("form") or attrs.get("form") == "")
|
|
39
|
+
):
|
|
40
|
+
self.current_form["file_form"] = True
|
|
41
|
+
elif (
|
|
42
|
+
self.in_form
|
|
43
|
+
and (
|
|
44
|
+
(tag == "input" and attrs.get("type") in {"submit", "image"})
|
|
45
|
+
or tag == "button"
|
|
46
|
+
)
|
|
47
|
+
and (not attrs.get("form") or attrs.get("form") == "")
|
|
48
|
+
):
|
|
49
|
+
self.current_form["submit_element_attrs"].append(attrs)
|
|
50
|
+
elif tag == "input" and attrs.get("form"):
|
|
51
|
+
self.referenced_file_inputs.append(attrs)
|
|
52
|
+
|
|
53
|
+
def handle_endtag(self, tag):
|
|
54
|
+
if tag == "form" and self.in_form:
|
|
55
|
+
self.forms.append(self.current_form)
|
|
56
|
+
self.in_form = False
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class AlertsPanel(Panel):
|
|
60
|
+
"""
|
|
61
|
+
A panel to alert users to issues.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
messages = {
|
|
65
|
+
"form_id_missing_enctype": _(
|
|
66
|
+
'Form with id "{form_id}" contains file input, but does not have the attribute enctype="multipart/form-data".'
|
|
67
|
+
),
|
|
68
|
+
"form_missing_enctype": _(
|
|
69
|
+
'Form contains file input, but does not have the attribute enctype="multipart/form-data".'
|
|
70
|
+
),
|
|
71
|
+
"input_refs_form_missing_enctype": _(
|
|
72
|
+
'Input element references form with id "{form_id}", but the form does not have the attribute enctype="multipart/form-data".'
|
|
73
|
+
),
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
title = _("Alerts")
|
|
77
|
+
|
|
78
|
+
template = "debug_toolbar/panels/alerts.html"
|
|
79
|
+
|
|
80
|
+
def __init__(self, *args, **kwargs):
|
|
81
|
+
super().__init__(*args, **kwargs)
|
|
82
|
+
self.alerts = []
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def nav_subtitle(self):
|
|
86
|
+
alerts = self.get_stats()["alerts"]
|
|
87
|
+
if alerts:
|
|
88
|
+
alert_text = "alert" if len(alerts) == 1 else "alerts"
|
|
89
|
+
return f"{len(alerts)} {alert_text}"
|
|
90
|
+
else:
|
|
91
|
+
return ""
|
|
92
|
+
|
|
93
|
+
def add_alert(self, alert):
|
|
94
|
+
self.alerts.append(alert)
|
|
95
|
+
|
|
96
|
+
def check_invalid_file_form_configuration(self, html_content):
|
|
97
|
+
"""
|
|
98
|
+
Inspects HTML content for a form that includes a file input but does
|
|
99
|
+
not have the encoding type set to multipart/form-data, and warns the
|
|
100
|
+
user if so.
|
|
101
|
+
"""
|
|
102
|
+
parser = FormParser()
|
|
103
|
+
parser.feed(html_content)
|
|
104
|
+
|
|
105
|
+
# Check for file inputs directly inside a form that do not reference
|
|
106
|
+
# any form through the form attribute
|
|
107
|
+
for form in parser.forms:
|
|
108
|
+
if (
|
|
109
|
+
form["file_form"]
|
|
110
|
+
and form["form_attrs"].get("enctype") != "multipart/form-data"
|
|
111
|
+
and not any(
|
|
112
|
+
elem.get("formenctype") == "multipart/form-data"
|
|
113
|
+
for elem in form["submit_element_attrs"]
|
|
114
|
+
)
|
|
115
|
+
):
|
|
116
|
+
if form_id := form["form_attrs"].get("id"):
|
|
117
|
+
alert = self.messages["form_id_missing_enctype"].format(
|
|
118
|
+
form_id=form_id
|
|
119
|
+
)
|
|
120
|
+
else:
|
|
121
|
+
alert = self.messages["form_missing_enctype"]
|
|
122
|
+
self.add_alert({"alert": alert})
|
|
123
|
+
|
|
124
|
+
# Check for file inputs that reference a form
|
|
125
|
+
form_attrs_by_id = {
|
|
126
|
+
form["form_attrs"].get("id"): form["form_attrs"] for form in parser.forms
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
for attrs in parser.referenced_file_inputs:
|
|
130
|
+
form_id = attrs.get("form")
|
|
131
|
+
if form_id and attrs.get("type") == "file":
|
|
132
|
+
form_attrs = form_attrs_by_id.get(form_id)
|
|
133
|
+
if form_attrs and form_attrs.get("enctype") != "multipart/form-data":
|
|
134
|
+
alert = self.messages["input_refs_form_missing_enctype"].format(
|
|
135
|
+
form_id=form_id
|
|
136
|
+
)
|
|
137
|
+
self.add_alert({"alert": alert})
|
|
138
|
+
|
|
139
|
+
return self.alerts
|
|
140
|
+
|
|
141
|
+
def generate_stats(self, request, response):
|
|
142
|
+
# check if streaming response
|
|
143
|
+
if getattr(response, "streaming", True):
|
|
144
|
+
return
|
|
145
|
+
|
|
146
|
+
html_content = response.content.decode(response.charset)
|
|
147
|
+
self.check_invalid_file_form_configuration(html_content)
|
|
148
|
+
|
|
149
|
+
# Further alert checks can go here
|
|
150
|
+
|
|
151
|
+
# Write all alerts to record_stats
|
|
152
|
+
self.record_stats({"alerts": self.alerts})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
|
|
3
|
+
from django.template.backends.jinja2 import Template as JinjaTemplate
|
|
4
|
+
from django.template.context import make_context
|
|
5
|
+
from django.test.signals import template_rendered
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def patch_jinja_render():
|
|
9
|
+
orig_render = JinjaTemplate.render
|
|
10
|
+
|
|
11
|
+
@functools.wraps(orig_render)
|
|
12
|
+
def wrapped_render(self, context=None, request=None):
|
|
13
|
+
# This patching of render only instruments the rendering
|
|
14
|
+
# of the immediate template. It won't include the parent template(s).
|
|
15
|
+
self.name = self.template.name
|
|
16
|
+
template_rendered.send(
|
|
17
|
+
sender=self, template=self, context=make_context(context, request)
|
|
18
|
+
)
|
|
19
|
+
return orig_render(self, context, request)
|
|
20
|
+
|
|
21
|
+
if JinjaTemplate.render != wrapped_render:
|
|
22
|
+
JinjaTemplate.original_render = JinjaTemplate.render
|
|
23
|
+
JinjaTemplate.render = wrapped_render
|
{django_debug_toolbar-4.4.2 → django_debug_toolbar-4.4.4}/debug_toolbar/panels/templates/panel.py
RENAMED
|
@@ -14,6 +14,7 @@ from django.utils.translation import gettext_lazy as _
|
|
|
14
14
|
from debug_toolbar.panels import Panel
|
|
15
15
|
from debug_toolbar.panels.sql.tracking import SQLQueryTriggered, allow_sql
|
|
16
16
|
from debug_toolbar.panels.templates import views
|
|
17
|
+
from debug_toolbar.panels.templates.jinja2 import patch_jinja_render
|
|
17
18
|
|
|
18
19
|
# Monkey-patch to enable the template_rendered signal. The receiver returns
|
|
19
20
|
# immediately when the panel is disabled to keep the overhead small.
|
|
@@ -25,6 +26,7 @@ if Template._render != instrumented_test_render:
|
|
|
25
26
|
Template.original_render = Template._render
|
|
26
27
|
Template._render = instrumented_test_render
|
|
27
28
|
|
|
29
|
+
patch_jinja_render()
|
|
28
30
|
|
|
29
31
|
# Monkey-patch to store items added by template context processors. The
|
|
30
32
|
# overhead is sufficiently small to justify enabling it unconditionally.
|
|
@@ -67,6 +67,7 @@ PANELS_DEFAULTS = [
|
|
|
67
67
|
"debug_toolbar.panels.sql.SQLPanel",
|
|
68
68
|
"debug_toolbar.panels.staticfiles.StaticFilesPanel",
|
|
69
69
|
"debug_toolbar.panels.templates.TemplatesPanel",
|
|
70
|
+
"debug_toolbar.panels.alerts.AlertsPanel",
|
|
70
71
|
"debug_toolbar.panels.cache.CachePanel",
|
|
71
72
|
"debug_toolbar.panels.signals.SignalsPanel",
|
|
72
73
|
"debug_toolbar.panels.redirects.RedirectsPanel",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* Variable definitions */
|
|
2
|
-
:root
|
|
3
|
-
#djDebug[data-theme="light"] {
|
|
2
|
+
:root {
|
|
4
3
|
/* Font families are the same as in Django admin/css/base.css */
|
|
5
4
|
--djdt-font-family-primary: "Segoe UI", system-ui, Roboto, "Helvetica Neue",
|
|
6
5
|
Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
|
@@ -10,7 +9,10 @@
|
|
|
10
9
|
"Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New",
|
|
11
10
|
monospace, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
12
11
|
"Noto Color Emoji";
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
+
:root,
|
|
15
|
+
#djDebug[data-theme="light"] {
|
|
14
16
|
--djdt-font-color: black;
|
|
15
17
|
--djdt-background-color: white;
|
|
16
18
|
--djdt-panel-content-background-color: #eee;
|
|
@@ -732,4 +734,6 @@
|
|
|
732
734
|
#djDebug[data-theme="dark"] #djToggleThemeButton svg.theme-dark,
|
|
733
735
|
#djDebug[data-theme="auto"] #djToggleThemeButton svg.theme-auto {
|
|
734
736
|
display: block;
|
|
737
|
+
height: 1rem;
|
|
738
|
+
width: 1rem;
|
|
735
739
|
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
aria-hidden="true"
|
|
3
3
|
class="djdt-hidden theme-auto"
|
|
4
4
|
fill="currentColor"
|
|
5
|
-
width="1rem"
|
|
6
|
-
height="1rem"
|
|
7
5
|
viewBox="0 0 32 32"
|
|
8
6
|
version="1.1"
|
|
9
7
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -15,8 +13,6 @@
|
|
|
15
13
|
<svg
|
|
16
14
|
aria-hidden="true"
|
|
17
15
|
class="djdt-hidden theme-light"
|
|
18
|
-
width="1rem"
|
|
19
|
-
height="1rem"
|
|
20
16
|
viewBox="0 0 24 24"
|
|
21
17
|
fill="none"
|
|
22
18
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -31,8 +27,6 @@
|
|
|
31
27
|
<svg
|
|
32
28
|
aria-hidden="true"
|
|
33
29
|
class="djdt-hidden theme-dark"
|
|
34
|
-
width="1rem"
|
|
35
|
-
height="1rem"
|
|
36
30
|
viewBox="0 0 24 24"
|
|
37
31
|
fill="none"
|
|
38
32
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
The main DebugToolbar class that loads and renders the Toolbar.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
import re
|
|
5
6
|
import uuid
|
|
6
7
|
from collections import OrderedDict
|
|
7
8
|
from functools import lru_cache
|
|
8
9
|
|
|
9
10
|
from django.apps import apps
|
|
11
|
+
from django.conf import settings
|
|
10
12
|
from django.core.exceptions import ImproperlyConfigured
|
|
11
13
|
from django.dispatch import Signal
|
|
12
14
|
from django.template import TemplateSyntaxError
|
|
13
15
|
from django.template.loader import render_to_string
|
|
14
|
-
from django.urls import path, resolve
|
|
16
|
+
from django.urls import include, path, re_path, resolve
|
|
15
17
|
from django.urls.exceptions import Resolver404
|
|
16
18
|
from django.utils.module_loading import import_string
|
|
17
19
|
from django.utils.translation import get_language, override as lang_override
|
|
@@ -186,3 +188,27 @@ def observe_request(request):
|
|
|
186
188
|
Determine whether to update the toolbar from a client side request.
|
|
187
189
|
"""
|
|
188
190
|
return True
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def debug_toolbar_urls(prefix="__debug__"):
|
|
194
|
+
"""
|
|
195
|
+
Return a URL pattern for serving toolbar in debug mode.
|
|
196
|
+
|
|
197
|
+
from django.conf import settings
|
|
198
|
+
from debug_toolbar.toolbar import debug_toolbar_urls
|
|
199
|
+
|
|
200
|
+
urlpatterns = [
|
|
201
|
+
# ... the rest of your URLconf goes here ...
|
|
202
|
+
] + debug_toolbar_urls()
|
|
203
|
+
"""
|
|
204
|
+
if not prefix:
|
|
205
|
+
raise ImproperlyConfigured("Empty urls prefix not permitted")
|
|
206
|
+
elif not settings.DEBUG:
|
|
207
|
+
# No-op if not in debug mode.
|
|
208
|
+
return []
|
|
209
|
+
return [
|
|
210
|
+
re_path(
|
|
211
|
+
r"^%s/" % re.escape(prefix.lstrip("/")),
|
|
212
|
+
include("debug_toolbar.urls"),
|
|
213
|
+
),
|
|
214
|
+
]
|
|
@@ -4,6 +4,28 @@ Change log
|
|
|
4
4
|
Pending
|
|
5
5
|
-------
|
|
6
6
|
|
|
7
|
+
4.4.4 (2024-07-05)
|
|
8
|
+
------------------
|
|
9
|
+
|
|
10
|
+
* Added check for StreamingHttpResponse in alerts panel.
|
|
11
|
+
* Instrument the Django Jinja2 template backend. This only instruments
|
|
12
|
+
the immediate template that's rendered. It will not provide stats on
|
|
13
|
+
any parent templates.
|
|
14
|
+
|
|
15
|
+
4.4.3 (2024-07-04)
|
|
16
|
+
------------------
|
|
17
|
+
|
|
18
|
+
* Added alerts panel with warning when form is using file fields
|
|
19
|
+
without proper encoding type.
|
|
20
|
+
* Fixed overriding font-family for both light and dark themes.
|
|
21
|
+
* Restored compatibility with ``iptools.IpRangeList``.
|
|
22
|
+
* Limit ``E001`` check to likely error cases when the
|
|
23
|
+
``SHOW_TOOLBAR_CALLBACK`` has changed, but the toolbar's URL
|
|
24
|
+
paths aren't installed.
|
|
25
|
+
* Introduce helper function ``debug_toolbar_urls`` to
|
|
26
|
+
simplify installation.
|
|
27
|
+
* Moved "1rem" height/width for SVGs to CSS properties.
|
|
28
|
+
|
|
7
29
|
4.4.2 (2024-05-27)
|
|
8
30
|
------------------
|
|
9
31
|
|
|
@@ -25,7 +25,7 @@ copyright = "{}, Django Debug Toolbar developers and contributors"
|
|
|
25
25
|
copyright = copyright.format(datetime.date.today().year)
|
|
26
26
|
|
|
27
27
|
# The full version, including alpha/beta/rc tags
|
|
28
|
-
release = "4.4.
|
|
28
|
+
release = "4.4.4"
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
# -- General configuration ---------------------------------------------------
|
|
@@ -29,6 +29,7 @@ default value is::
|
|
|
29
29
|
'debug_toolbar.panels.sql.SQLPanel',
|
|
30
30
|
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
|
|
31
31
|
'debug_toolbar.panels.templates.TemplatesPanel',
|
|
32
|
+
'debug_toolbar.panels.alerts.AlertsPanel',
|
|
32
33
|
'debug_toolbar.panels.cache.CachePanel',
|
|
33
34
|
'debug_toolbar.panels.signals.SignalsPanel',
|
|
34
35
|
'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
@@ -152,6 +153,16 @@ Toolbar options
|
|
|
152
153
|
implication is that it is possible to execute arbitrary SQL through the
|
|
153
154
|
SQL panel when the ``SECRET_KEY`` value is leaked somehow.
|
|
154
155
|
|
|
156
|
+
.. warning::
|
|
157
|
+
|
|
158
|
+
Do not use
|
|
159
|
+
``DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda request: DEBUG}``
|
|
160
|
+
in your project's settings.py file. The toolbar expects to use
|
|
161
|
+
``django.conf.settings.DEBUG``. Using your project's setting's ``DEBUG``
|
|
162
|
+
is likely to cause unexpected results when running your tests. This is because
|
|
163
|
+
Django automatically sets ``settings.DEBUG = False``, but your project's
|
|
164
|
+
setting's ``DEBUG`` will still be set to ``True``.
|
|
165
|
+
|
|
155
166
|
.. _OBSERVE_REQUEST_CALLBACK:
|
|
156
167
|
|
|
157
168
|
* ``OBSERVE_REQUEST_CALLBACK``
|
|
@@ -95,14 +95,14 @@ Add django-debug-toolbar's URLs to your project's URLconf:
|
|
|
95
95
|
.. code-block:: python
|
|
96
96
|
|
|
97
97
|
from django.urls import include, path
|
|
98
|
+
from debug_toolbar.toolbar import debug_toolbar_urls
|
|
98
99
|
|
|
99
100
|
urlpatterns = [
|
|
100
|
-
# ...
|
|
101
|
-
|
|
102
|
-
]
|
|
101
|
+
# ... the rest of your URLconf goes here ...
|
|
102
|
+
] + debug_toolbar_urls()
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
doesn't clash with your application's URLs.
|
|
104
|
+
By default this uses the ``__debug__`` prefix for the paths, but you can
|
|
105
|
+
use any prefix that doesn't clash with your application's URLs.
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
5. Add the Middleware
|
|
@@ -180,11 +180,13 @@ You should also modify your URLconf file:
|
|
|
180
180
|
|
|
181
181
|
.. code-block:: python
|
|
182
182
|
|
|
183
|
+
from django.conf import settings
|
|
184
|
+
from debug_toolbar.toolbar import debug_toolbar_urls
|
|
185
|
+
|
|
183
186
|
if not settings.TESTING:
|
|
184
187
|
urlpatterns = [
|
|
185
188
|
*urlpatterns,
|
|
186
|
-
|
|
187
|
-
]
|
|
189
|
+
] + debug_toolbar_urls()
|
|
188
190
|
|
|
189
191
|
Alternatively, you can check out the :ref:`IS_RUNNING_TESTS <IS_RUNNING_TESTS>`
|
|
190
192
|
option.
|
|
@@ -9,6 +9,17 @@ Default built-in panels
|
|
|
9
9
|
|
|
10
10
|
The following panels are enabled by default.
|
|
11
11
|
|
|
12
|
+
Alerts
|
|
13
|
+
~~~~~~~
|
|
14
|
+
|
|
15
|
+
.. class:: debug_toolbar.panels.alerts.AlertsPanel
|
|
16
|
+
|
|
17
|
+
This panel shows alerts for a set of pre-defined cases:
|
|
18
|
+
|
|
19
|
+
- Alerts when the response has a form without the
|
|
20
|
+
``enctype="multipart/form-data"`` attribute and the form contains
|
|
21
|
+
a file input.
|
|
22
|
+
|
|
12
23
|
History
|
|
13
24
|
~~~~~~~
|
|
14
25
|
|
|
@@ -41,6 +41,12 @@ ROOT_URLCONF = "example.urls"
|
|
|
41
41
|
STATIC_URL = "/static/"
|
|
42
42
|
|
|
43
43
|
TEMPLATES = [
|
|
44
|
+
{
|
|
45
|
+
"NAME": "jinja2",
|
|
46
|
+
"BACKEND": "django.template.backends.jinja2.Jinja2",
|
|
47
|
+
"APP_DIRS": True,
|
|
48
|
+
"DIRS": [os.path.join(BASE_DIR, "example", "templates", "jinja2")],
|
|
49
|
+
},
|
|
44
50
|
{
|
|
45
51
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
46
52
|
"APP_DIRS": True,
|
|
@@ -54,7 +60,7 @@ TEMPLATES = [
|
|
|
54
60
|
"django.contrib.messages.context_processors.messages",
|
|
55
61
|
],
|
|
56
62
|
},
|
|
57
|
-
}
|
|
63
|
+
},
|
|
58
64
|
]
|
|
59
65
|
|
|
60
66
|
USE_TZ = True
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% load cache %}
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
6
|
+
<title>Bad form</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<h1>Bad form test</h1>
|
|
10
|
+
<form>
|
|
11
|
+
<input type="file" name="file" />
|
|
12
|
+
</form>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
<h1>Index of Tests</h1>
|
|
10
10
|
{% cache 10 index_cache %}
|
|
11
11
|
<ul>
|
|
12
|
+
<li><a href="{% url 'jinja' %}">Jinja2</a></li>
|
|
12
13
|
<li><a href="/jquery/">jQuery 3.3.1</a></li>
|
|
13
14
|
<li><a href="/mootools/">MooTools 1.6.0</a></li>
|
|
14
15
|
<li><a href="/prototype/">Prototype 1.7.3.0</a></li>
|
|
15
16
|
<li><a href="{% url 'turbo' %}">Hotwire Turbo</a></li>
|
|
16
17
|
<li><a href="{% url 'htmx' %}">htmx</a></li>
|
|
18
|
+
<li><a href="{% url 'bad_form' %}">Bad form</a></li>
|
|
17
19
|
</ul>
|
|
18
20
|
<p><a href="/admin/">Django Admin</a></p>
|
|
19
21
|
{% endcache %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
5
|
+
<title>jinja Test</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<h1>jinja Test</h1>
|
|
9
|
+
{{ foo }}
|
|
10
|
+
{% for i in range(10) %}{{ i }}{% endfor %} {# Jinja2 supports range(), Django templates do not #}
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|