django-debug-toolbar 4.2.0__tar.gz → 4.4.0__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.
Files changed (206) hide show
  1. django_debug_toolbar-4.4.0/.github/dependabot.yml +13 -0
  2. django_debug_toolbar-4.4.0/.github/workflows/coverage.yml +33 -0
  3. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.github/workflows/release.yml +2 -2
  4. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.github/workflows/test.yml +21 -64
  5. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.pre-commit-config.yaml +15 -15
  6. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/Makefile +3 -0
  7. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/PKG-INFO +10 -8
  8. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/README.rst +5 -2
  9. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/__init__.py +1 -1
  10. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/apps.py +39 -2
  11. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/middleware.py +17 -1
  12. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/profiling.py +10 -8
  13. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/sql/tracking.py +1 -18
  14. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/staticfiles.py +0 -25
  15. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/templates/panel.py +67 -54
  16. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/settings.py +4 -0
  17. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/static/debug_toolbar/css/toolbar.css +121 -39
  18. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/static/debug_toolbar/js/history.js +3 -0
  19. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/static/debug_toolbar/js/toolbar.js +30 -3
  20. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/static/debug_toolbar/js/utils.js +5 -1
  21. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/base.html +7 -1
  22. django_debug_toolbar-4.4.0/debug_toolbar/templates/debug_toolbar/includes/theme_selector.html +47 -0
  23. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/history.html +1 -1
  24. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/history_tr.html +1 -1
  25. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/sql.html +1 -1
  26. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/toolbar.py +1 -1
  27. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/utils.py +10 -8
  28. django_debug_toolbar-4.4.0/docs/architecture.rst +84 -0
  29. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/changes.rst +58 -0
  30. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/checks.rst +3 -0
  31. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/conf.py +1 -1
  32. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/configuration.rst +40 -7
  33. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/contributing.rst +12 -0
  34. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/index.rst +1 -0
  35. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/installation.rst +14 -6
  36. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/panels.rst +4 -42
  37. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/spelling_wordlist.txt +3 -0
  38. django_debug_toolbar-4.4.0/eslint.config.js +28 -0
  39. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/settings.py +17 -3
  40. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/templates/index.html +2 -2
  41. django_debug_toolbar-4.4.0/example/test_views.py +12 -0
  42. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/urls.py +6 -1
  43. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/pyproject.toml +34 -51
  44. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/setup.py +0 -9
  45. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_profiling.py +7 -0
  46. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_staticfiles.py +0 -37
  47. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_template.py +23 -2
  48. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/settings.py +3 -1
  49. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/sync.py +1 -0
  50. django_debug_toolbar-4.4.0/tests/templates/ajax/ajax.html +21 -0
  51. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/test_checks.py +49 -24
  52. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/test_integration.py +84 -13
  53. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/test_utils.py +9 -3
  54. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/urls.py +1 -0
  55. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/urls_invalid.py +1 -0
  56. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/urls_use_package_urls.py +1 -0
  57. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/views.py +4 -0
  58. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tox.ini +15 -13
  59. django_debug_toolbar-4.2.0/.eslintrc.json +0 -20
  60. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.editorconfig +0 -0
  61. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  62. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.gitignore +0 -0
  63. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.readthedocs.yaml +0 -0
  64. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/.tx/config +0 -0
  65. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/CODE_OF_CONDUCT.md +0 -0
  66. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/CONTRIBUTING.md +0 -0
  67. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/LICENSE +0 -0
  68. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/_stubs.py +0 -0
  69. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/decorators.py +0 -0
  70. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/forms.py +0 -0
  71. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/ca/LC_MESSAGES/django.mo +0 -0
  72. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/ca/LC_MESSAGES/django.po +0 -0
  73. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/cs/LC_MESSAGES/django.mo +0 -0
  74. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/cs/LC_MESSAGES/django.po +0 -0
  75. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/de/LC_MESSAGES/django.mo +0 -0
  76. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/de/LC_MESSAGES/django.po +0 -0
  77. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/en/LC_MESSAGES/django.mo +0 -0
  78. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/en/LC_MESSAGES/django.po +0 -0
  79. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/es/LC_MESSAGES/django.mo +0 -0
  80. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/es/LC_MESSAGES/django.po +0 -0
  81. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/fa/LC_MESSAGES/django.mo +0 -0
  82. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/fa/LC_MESSAGES/django.po +0 -0
  83. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/fi/LC_MESSAGES/django.mo +0 -0
  84. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/fi/LC_MESSAGES/django.po +0 -0
  85. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/fr/LC_MESSAGES/django.mo +0 -0
  86. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/fr/LC_MESSAGES/django.po +0 -0
  87. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/he/LC_MESSAGES/django.mo +0 -0
  88. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/he/LC_MESSAGES/django.po +0 -0
  89. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/id/LC_MESSAGES/django.mo +0 -0
  90. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/id/LC_MESSAGES/django.po +0 -0
  91. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/it/LC_MESSAGES/django.mo +0 -0
  92. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/it/LC_MESSAGES/django.po +0 -0
  93. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/ja/LC_MESSAGES/django.mo +0 -0
  94. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/ja/LC_MESSAGES/django.po +0 -0
  95. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/nl/LC_MESSAGES/django.mo +0 -0
  96. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/nl/LC_MESSAGES/django.po +0 -0
  97. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/pl/LC_MESSAGES/django.mo +0 -0
  98. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/pl/LC_MESSAGES/django.po +0 -0
  99. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/pt/LC_MESSAGES/django.mo +0 -0
  100. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/pt/LC_MESSAGES/django.po +0 -0
  101. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.mo +0 -0
  102. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.po +0 -0
  103. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/ru/LC_MESSAGES/django.mo +0 -0
  104. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/ru/LC_MESSAGES/django.po +0 -0
  105. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/sk/LC_MESSAGES/django.mo +0 -0
  106. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/sk/LC_MESSAGES/django.po +0 -0
  107. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.mo +0 -0
  108. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.po +0 -0
  109. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/uk/LC_MESSAGES/django.mo +0 -0
  110. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/uk/LC_MESSAGES/django.po +0 -0
  111. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.mo +0 -0
  112. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.po +0 -0
  113. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/management/__init__.py +0 -0
  114. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/management/commands/__init__.py +0 -0
  115. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/management/commands/debugsqlshell.py +0 -0
  116. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/__init__.py +0 -0
  117. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/cache.py +0 -0
  118. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/headers.py +0 -0
  119. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/history/__init__.py +0 -0
  120. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/history/forms.py +0 -0
  121. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/history/panel.py +0 -0
  122. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/history/views.py +0 -0
  123. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/redirects.py +0 -0
  124. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/request.py +0 -0
  125. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/settings.py +0 -0
  126. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/signals.py +0 -0
  127. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/sql/__init__.py +0 -0
  128. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/sql/forms.py +0 -0
  129. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/sql/panel.py +0 -0
  130. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/sql/utils.py +0 -0
  131. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/sql/views.py +0 -0
  132. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/templates/__init__.py +0 -0
  133. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/templates/views.py +0 -0
  134. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/timer.py +0 -0
  135. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/panels/versions.py +0 -0
  136. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/static/debug_toolbar/css/print.css +0 -0
  137. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/static/debug_toolbar/js/redirect.js +0 -0
  138. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/static/debug_toolbar/js/timer.js +0 -0
  139. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/includes/panel_button.html +0 -0
  140. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/includes/panel_content.html +0 -0
  141. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/cache.html +0 -0
  142. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/headers.html +0 -0
  143. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/profiling.html +0 -0
  144. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/request.html +0 -0
  145. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/request_variables.html +0 -0
  146. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/settings.html +0 -0
  147. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/signals.html +0 -0
  148. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html +0 -0
  149. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html +0 -0
  150. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/sql_select.html +0 -0
  151. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/staticfiles.html +0 -0
  152. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/template_source.html +0 -0
  153. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/templates.html +0 -0
  154. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/timer.html +0 -0
  155. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/panels/versions.html +0 -0
  156. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templates/debug_toolbar/redirect.html +0 -0
  157. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/templatetags/__init__.py +0 -0
  158. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/urls.py +0 -0
  159. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/debug_toolbar/views.py +0 -0
  160. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/Makefile +0 -0
  161. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/commands.rst +0 -0
  162. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/make.bat +0 -0
  163. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/docs/tips.rst +0 -0
  164. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/README.rst +0 -0
  165. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/__init__.py +0 -0
  166. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/django-debug-toolbar.png +0 -0
  167. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/example.db +0 -0
  168. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/manage.py +0 -0
  169. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/screenshot.py +0 -0
  170. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/static/test.css +0 -0
  171. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/templates/htmx/boost.html +0 -0
  172. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/templates/jquery/index.html +0 -0
  173. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/templates/mootools/index.html +0 -0
  174. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/templates/prototype/index.html +0 -0
  175. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/templates/turbo/index.html +0 -0
  176. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/views.py +0 -0
  177. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/example/wsgi.py +0 -0
  178. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/requirements_dev.txt +0 -0
  179. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/__init__.py +0 -0
  180. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/additional_static/base.css +0 -0
  181. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/base.py +0 -0
  182. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/commands/__init__.py +0 -0
  183. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/commands/test_debugsqlshell.py +0 -0
  184. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/context_processors.py +0 -0
  185. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/forms.py +0 -0
  186. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/loaders.py +0 -0
  187. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/middleware.py +0 -0
  188. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/models.py +0 -0
  189. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/__init__.py +0 -0
  190. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_cache.py +0 -0
  191. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_custom.py +0 -0
  192. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_history.py +0 -0
  193. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_redirects.py +0 -0
  194. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_request.py +0 -0
  195. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_settings.py +0 -0
  196. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_sql.py +0 -0
  197. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/panels/test_versions.py +0 -0
  198. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/templates/base.html +0 -0
  199. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/templates/basic.html +0 -0
  200. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/templates/jinja2/basic.jinja +0 -0
  201. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/templates/registration/login.html +0 -0
  202. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/templates/sql/flat.html +0 -0
  203. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/templates/sql/included.html +0 -0
  204. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/templates/sql/nested.html +0 -0
  205. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/test_decorators.py +0 -0
  206. {django_debug_toolbar-4.2.0 → django_debug_toolbar-4.4.0}/tests/test_forms.py +0 -0
@@ -0,0 +1,13 @@
1
+ # Keep GitHub Actions up to date with GitHub's Dependabot...
2
+ # https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
3
+ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: github-actions
7
+ directory: /
8
+ groups:
9
+ github-actions:
10
+ patterns:
11
+ - "*" # Group all Actions updates into a single larger pull request
12
+ schedule:
13
+ interval: weekly
@@ -0,0 +1,33 @@
1
+ # .github/workflows/coverage.yml
2
+ name: Post coverage comment
3
+
4
+ on:
5
+ workflow_run:
6
+ workflows: ["Test"]
7
+ types:
8
+ - completed
9
+
10
+ jobs:
11
+ test:
12
+ name: Run tests & display coverage
13
+ runs-on: ubuntu-latest
14
+ if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
15
+ permissions:
16
+ # Gives the action the necessary permissions for publishing new
17
+ # comments in pull requests.
18
+ pull-requests: write
19
+ # Gives the action the necessary permissions for editing existing
20
+ # comments (to avoid publishing multiple comments in the same PR)
21
+ contents: write
22
+ # Gives the action the necessary permissions for looking up the
23
+ # workflow that launched this workflow, and download the related
24
+ # artifact that contains the comment to be published
25
+ actions: read
26
+ steps:
27
+ # DO NOT run actions/checkout here, for security reasons
28
+ # For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
29
+ - name: Post comment
30
+ uses: py-cov-action/python-coverage-comment-action@v3
31
+ with:
32
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
+ GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
@@ -11,12 +11,12 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
 
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v4
15
15
  with:
16
16
  fetch-depth: 0
17
17
 
18
18
  - name: Set up Python
19
- uses: actions/setup-python@v2
19
+ uses: actions/setup-python@v5
20
20
  with:
21
21
  python-version: 3.8
22
22
 
@@ -14,7 +14,7 @@ jobs:
14
14
  fail-fast: false
15
15
  max-parallel: 5
16
16
  matrix:
17
- python-version: ['3.8', '3.9', '3.10', '3.11']
17
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
18
18
 
19
19
  services:
20
20
  mariadb:
@@ -30,12 +30,13 @@ jobs:
30
30
  - 3306:3306
31
31
 
32
32
  steps:
33
- - uses: actions/checkout@v3
33
+ - uses: actions/checkout@v4
34
34
 
35
35
  - name: Set up Python ${{ matrix.python-version }}
36
- uses: actions/setup-python@v4
36
+ uses: actions/setup-python@v5
37
37
  with:
38
38
  python-version: ${{ matrix.python-version }}
39
+ allow-prereleases: true
39
40
 
40
41
  - name: Get pip cache dir
41
42
  id: pip-cache
@@ -43,7 +44,7 @@ jobs:
43
44
  echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
44
45
 
45
46
  - name: Cache
46
- uses: actions/cache@v3
47
+ uses: actions/cache@v4
47
48
  with:
48
49
  path: ${{ steps.pip-cache.outputs.dir }}
49
50
  key:
@@ -65,11 +66,6 @@ jobs:
65
66
  DB_HOST: 127.0.0.1
66
67
  DB_PORT: 3306
67
68
 
68
- - name: Upload coverage data
69
- uses: actions/upload-artifact@v3
70
- with:
71
- name: coverage-data
72
- path: ".coverage.*"
73
69
 
74
70
  postgres:
75
71
  runs-on: ubuntu-latest
@@ -77,14 +73,16 @@ jobs:
77
73
  fail-fast: false
78
74
  max-parallel: 5
79
75
  matrix:
80
- python-version: ['3.8', '3.9', '3.10', '3.11']
76
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
81
77
  database: [postgresql, postgis]
82
- # Add psycopg3 to our matrix for 3.10 and 3.11
78
+ # Add psycopg3 to our matrix for modern python versions
83
79
  include:
84
80
  - python-version: '3.10'
85
81
  database: psycopg3
86
82
  - python-version: '3.11'
87
83
  database: psycopg3
84
+ - python-version: '3.12'
85
+ database: psycopg3
88
86
 
89
87
  services:
90
88
  postgres:
@@ -102,12 +100,13 @@ jobs:
102
100
  --health-retries 5
103
101
 
104
102
  steps:
105
- - uses: actions/checkout@v3
103
+ - uses: actions/checkout@v4
106
104
 
107
105
  - name: Set up Python ${{ matrix.python-version }}
108
- uses: actions/setup-python@v4
106
+ uses: actions/setup-python@v5
109
107
  with:
110
108
  python-version: ${{ matrix.python-version }}
109
+ allow-prereleases: true
111
110
 
112
111
  - name: Get pip cache dir
113
112
  id: pip-cache
@@ -115,7 +114,7 @@ jobs:
115
114
  echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
116
115
 
117
116
  - name: Cache
118
- uses: actions/cache@v3
117
+ uses: actions/cache@v4
119
118
  with:
120
119
  path: ${{ steps.pip-cache.outputs.dir }}
121
120
  key:
@@ -140,27 +139,22 @@ jobs:
140
139
  DB_HOST: localhost
141
140
  DB_PORT: 5432
142
141
 
143
- - name: Upload coverage data
144
- uses: actions/upload-artifact@v3
145
- with:
146
- name: coverage-data
147
- path: ".coverage.*"
148
-
149
142
  sqlite:
150
143
  runs-on: ubuntu-latest
151
144
  strategy:
152
145
  fail-fast: false
153
146
  max-parallel: 5
154
147
  matrix:
155
- python-version: ['3.8', '3.9', '3.10', '3.11']
148
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
156
149
 
157
150
  steps:
158
- - uses: actions/checkout@v3
151
+ - uses: actions/checkout@v4
159
152
 
160
153
  - name: Set up Python ${{ matrix.python-version }}
161
- uses: actions/setup-python@v4
154
+ uses: actions/setup-python@v5
162
155
  with:
163
156
  python-version: ${{ matrix.python-version }}
157
+ allow-prereleases: true
164
158
 
165
159
  - name: Get pip cache dir
166
160
  id: pip-cache
@@ -168,7 +162,7 @@ jobs:
168
162
  echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
169
163
 
170
164
  - name: Cache
171
- uses: actions/cache@v3
165
+ uses: actions/cache@v4
172
166
  with:
173
167
  path: ${{ steps.pip-cache.outputs.dir }}
174
168
  key:
@@ -187,53 +181,16 @@ jobs:
187
181
  DB_BACKEND: sqlite3
188
182
  DB_NAME: ":memory:"
189
183
 
190
- - name: Upload coverage data
191
- uses: actions/upload-artifact@v3
192
- with:
193
- name: coverage-data
194
- path: ".coverage.*"
195
-
196
- coverage:
197
- name: Check coverage.
198
- runs-on: "ubuntu-latest"
199
- needs: [sqlite, mysql, postgres]
200
- steps:
201
- - uses: actions/checkout@v3
202
- - uses: actions/setup-python@v4
203
- with:
204
- # Use latest, so it understands all syntax.
205
- python-version: "3.11"
206
-
207
- - run: python -m pip install --upgrade coverage[toml]
208
-
209
- - name: Download coverage data.
210
- uses: actions/download-artifact@v3
211
- with:
212
- name: coverage-data
213
-
214
- - name: Combine coverage & check percentage
215
- run: |
216
- python -m coverage combine
217
- python -m coverage html
218
- python -m coverage report
219
-
220
- - name: Upload HTML report if check failed.
221
- uses: actions/upload-artifact@v3
222
- with:
223
- name: html-report
224
- path: htmlcov
225
- if: ${{ failure() }}
226
-
227
184
  lint:
228
185
  runs-on: ubuntu-latest
229
186
  strategy:
230
187
  fail-fast: false
231
188
 
232
189
  steps:
233
- - uses: actions/checkout@v3
190
+ - uses: actions/checkout@v4
234
191
 
235
192
  - name: Set up Python ${{ matrix.python-version }}
236
- uses: actions/setup-python@v4
193
+ uses: actions/setup-python@v5
237
194
  with:
238
195
  python-version: 3.8
239
196
 
@@ -243,7 +200,7 @@ jobs:
243
200
  echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
244
201
 
245
202
  - name: Cache
246
- uses: actions/cache@v3
203
+ uses: actions/cache@v4
247
204
  with:
248
205
  path: ${{ steps.pip-cache.outputs.dir }}
249
206
  key:
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
- rev: v4.4.0
3
+ rev: v4.6.0
4
4
  hooks:
5
5
  - id: check-toml
6
6
  - id: check-yaml
@@ -14,46 +14,46 @@ repos:
14
14
  hooks:
15
15
  - id: doc8
16
16
  - repo: https://github.com/adamchainz/django-upgrade
17
- rev: 1.14.0
17
+ rev: 1.16.0
18
18
  hooks:
19
19
  - id: django-upgrade
20
- args: [--target-version, "3.2"]
20
+ args: [--target-version, "4.2"]
21
21
  - repo: https://github.com/pre-commit/pygrep-hooks
22
22
  rev: v1.10.0
23
23
  hooks:
24
24
  - id: rst-backticks
25
25
  - id: rst-directive-colons
26
26
  - repo: https://github.com/pre-commit/mirrors-prettier
27
- rev: v3.0.1
27
+ rev: v4.0.0-alpha.8
28
28
  hooks:
29
29
  - id: prettier
30
+ entry: env PRETTIER_LEGACY_CLI=1 prettier
30
31
  types_or: [javascript, css]
31
32
  args:
32
- - --trailing-comma=es5
33
+ - --trailing-comma=es5
33
34
  - repo: https://github.com/pre-commit/mirrors-eslint
34
- rev: v8.46.0
35
+ rev: v9.0.0
35
36
  hooks:
36
37
  - id: eslint
38
+ additional_dependencies:
39
+ - "eslint@v9.0.0-beta.1"
40
+ - "@eslint/js@v9.0.0-beta.1"
41
+ - "globals"
37
42
  files: \.js?$
38
43
  types: [file]
39
44
  args:
40
45
  - --fix
41
46
  - repo: https://github.com/astral-sh/ruff-pre-commit
42
- rev: 'v0.0.282'
47
+ rev: 'v0.3.7'
43
48
  hooks:
44
49
  - id: ruff
45
50
  args: [--fix, --exit-non-zero-on-fix]
46
- - repo: https://github.com/psf/black
47
- rev: 23.7.0
48
- hooks:
49
- - id: black
50
- language_version: python3
51
- entry: black --target-version=py38
51
+ - id: ruff-format
52
52
  - repo: https://github.com/tox-dev/pyproject-fmt
53
- rev: 0.13.0
53
+ rev: 1.7.0
54
54
  hooks:
55
55
  - id: pyproject-fmt
56
56
  - repo: https://github.com/abravalheri/validate-pyproject
57
- rev: v0.13
57
+ rev: v0.16
58
58
  hooks:
59
59
  - id: validate-pyproject
@@ -6,6 +6,9 @@ example:
6
6
  --noinput --username="$(USER)" --email="$(USER)@mailinator.com"
7
7
  python example/manage.py runserver
8
8
 
9
+ example_test:
10
+ python example/manage.py test example
11
+
9
12
  test:
10
13
  DJANGO_SETTINGS_MODULE=tests.settings \
11
14
  python -m django test $${TEST_ARGS:-tests}
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: django-debug-toolbar
3
- Version: 4.2.0
3
+ Version: 4.4.0
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
@@ -10,10 +10,8 @@ License-File: LICENSE
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Web Environment
12
12
  Classifier: Framework :: Django
13
- Classifier: Framework :: Django :: 3.2
14
- Classifier: Framework :: Django :: 4.0
15
- Classifier: Framework :: Django :: 4.1
16
13
  Classifier: Framework :: Django :: 4.2
14
+ Classifier: Framework :: Django :: 5.0
17
15
  Classifier: Intended Audience :: Developers
18
16
  Classifier: License :: OSI Approved :: BSD License
19
17
  Classifier: Operating System :: OS Independent
@@ -23,9 +21,10 @@ Classifier: Programming Language :: Python :: 3.8
23
21
  Classifier: Programming Language :: Python :: 3.9
24
22
  Classifier: Programming Language :: Python :: 3.10
25
23
  Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
26
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
26
  Requires-Python: >=3.8
28
- Requires-Dist: django>=3.2.4
27
+ Requires-Dist: django>=4.2.9
29
28
  Requires-Dist: sqlparse>=0.2
30
29
  Description-Content-Type: text/x-rst
31
30
 
@@ -75,8 +74,11 @@ Here's a screenshot of the toolbar in action:
75
74
  In addition to the built-in panels, a number of third-party panels are
76
75
  contributed by the community.
77
76
 
78
- The current stable version of the Debug Toolbar is 4.1.0. It works on
79
- Django ≥ 3.2.4.
77
+ The current stable version of the Debug Toolbar is 4.4.0. It works on
78
+ Django ≥ 4.2.0.
79
+
80
+ The Debug Toolbar does not currently support `Django's asynchronous views
81
+ <https://docs.djangoproject.com/en/dev/topics/async/>`_.
80
82
 
81
83
  Documentation, including installation and configuration instructions, is
82
84
  available at https://django-debug-toolbar.readthedocs.io/.
@@ -44,8 +44,11 @@ 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.1.0. It works on
48
- Django ≥ 3.2.4.
47
+ The current stable version of the Debug Toolbar is 4.4.0. It works on
48
+ Django ≥ 4.2.0.
49
+
50
+ The Debug Toolbar does not currently support `Django's asynchronous views
51
+ <https://docs.djangoproject.com/en/dev/topics/async/>`_.
49
52
 
50
53
  Documentation, including installation and configuration instructions, is
51
54
  available at https://django-debug-toolbar.readthedocs.io/.
@@ -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.2.0"
7
+ VERSION = "4.4.0"
8
8
 
9
9
  # Code that discovers files or modules in INSTALLED_APPS imports this module.
10
10
  urls = "debug_toolbar.urls", APP_NAME
@@ -3,7 +3,7 @@ import mimetypes
3
3
 
4
4
  from django.apps import AppConfig
5
5
  from django.conf import settings
6
- from django.core.checks import Warning, register
6
+ from django.core.checks import Error, Warning, register
7
7
  from django.middleware.gzip import GZipMiddleware
8
8
  from django.utils.module_loading import import_string
9
9
  from django.utils.translation import gettext_lazy as _
@@ -177,7 +177,7 @@ def check_panels(app_configs, **kwargs):
177
177
  return errors
178
178
 
179
179
 
180
- @register()
180
+ @register
181
181
  def js_mimetype_check(app_configs, **kwargs):
182
182
  """
183
183
  Check that JavaScript files are resolving to the correct content type.
@@ -206,3 +206,40 @@ def js_mimetype_check(app_configs, **kwargs):
206
206
  )
207
207
  ]
208
208
  return []
209
+
210
+
211
+ @register
212
+ def debug_toolbar_installed_when_running_tests_check(app_configs, **kwargs):
213
+ """
214
+ Check that the toolbar is not being used when tests are running
215
+ """
216
+ if not settings.DEBUG and dt_settings.get_config()["IS_RUNNING_TESTS"]:
217
+ return [
218
+ Error(
219
+ "The Django Debug Toolbar can't be used with tests",
220
+ hint="Django changes the DEBUG setting to False when running "
221
+ "tests. By default the Django Debug Toolbar is installed because "
222
+ "DEBUG is set to True. For most cases, you need to avoid installing "
223
+ "the toolbar when running tests. If you feel this check is in error, "
224
+ "you can set `DEBUG_TOOLBAR_CONFIG['IS_RUNNING_TESTS'] = False` to "
225
+ "bypass this check.",
226
+ id="debug_toolbar.E001",
227
+ )
228
+ ]
229
+ else:
230
+ return []
231
+
232
+
233
+ @register
234
+ def check_settings(app_configs, **kwargs):
235
+ errors = []
236
+ USER_CONFIG = getattr(settings, "DEBUG_TOOLBAR_CONFIG", {})
237
+ if "OBSERVE_REQUEST_CALLBACK" in USER_CONFIG:
238
+ errors.append(
239
+ Warning(
240
+ "The deprecated OBSERVE_REQUEST_CALLBACK setting is present in DEBUG_TOOLBAR_CONFIG.",
241
+ hint="Use the UPDATE_ON_FETCH and/or SHOW_TOOLBAR_CALLBACK settings instead.",
242
+ id="debug_toolbar.W008",
243
+ )
244
+ )
245
+ return errors
@@ -3,6 +3,7 @@ Debug Toolbar middleware
3
3
  """
4
4
 
5
5
  import re
6
+ import socket
6
7
  from functools import lru_cache
7
8
 
8
9
  from django.conf import settings
@@ -19,7 +20,22 @@ def show_toolbar(request):
19
20
  """
20
21
  Default function to determine whether to show the toolbar on a given page.
21
22
  """
22
- return settings.DEBUG and request.META.get("REMOTE_ADDR") in settings.INTERNAL_IPS
23
+ internal_ips = settings.INTERNAL_IPS.copy()
24
+
25
+ try:
26
+ # This is a hack for docker installations. It attempts to look
27
+ # up the IP address of the docker host.
28
+ # This is not guaranteed to work.
29
+ docker_ip = (
30
+ # Convert the last segment of the IP address to be .1
31
+ ".".join(socket.gethostbyname("host.docker.internal").rsplit(".")[:-1])
32
+ + ".1"
33
+ )
34
+ internal_ips.append(docker_ip)
35
+ except socket.gaierror:
36
+ # It's fine if the lookup errored since they may not be using docker
37
+ pass
38
+ return settings.DEBUG and request.META.get("REMOTE_ADDR") in internal_ips
23
39
 
24
40
 
25
41
  @lru_cache(maxsize=None)
@@ -42,10 +42,14 @@ class FunctionCall:
42
42
  """
43
43
  if hasattr(settings, "BASE_DIR"):
44
44
  file_name, _, _ = self.func
45
- return (
46
- str(settings.BASE_DIR) in file_name
47
- and "/site-packages/" not in file_name
48
- and "/dist-packages/" not in file_name
45
+ base_dir = str(settings.BASE_DIR)
46
+
47
+ file_name = os.path.normpath(file_name)
48
+ base_dir = os.path.normpath(base_dir)
49
+
50
+ return file_name.startswith(base_dir) and not any(
51
+ directory in file_name.split(os.path.sep)
52
+ for directory in ["site-packages", "dist-packages"]
49
53
  )
50
54
  return None
51
55
 
@@ -82,12 +86,10 @@ class FunctionCall:
82
86
  )
83
87
 
84
88
  def subfuncs(self):
85
- i = 0
86
89
  h, s, v = self.hsv
87
90
  count = len(self.statobj.all_callees[self.func])
88
- for func, stats in self.statobj.all_callees[self.func].items():
89
- i += 1
90
- h1 = h + (i / count) / (self.depth + 1)
91
+ for i, (func, stats) in enumerate(self.statobj.all_callees[self.func].items()):
92
+ h1 = h + ((i + 1) / count) / (self.depth + 1)
91
93
  s1 = 0 if stats[3] == 0 else s * (stats[3] / self.stats[3])
92
94
  yield FunctionCall(
93
95
  self.statobj,
@@ -109,21 +109,6 @@ class NormalCursorMixin(DjDTCursorWrapperMixin):
109
109
  Wraps a cursor and logs queries.
110
110
  """
111
111
 
112
- def _quote_expr(self, element):
113
- if isinstance(element, str):
114
- return "'%s'" % element.replace("'", "''")
115
- else:
116
- return repr(element)
117
-
118
- def _quote_params(self, params):
119
- if not params:
120
- return params
121
- if isinstance(params, dict):
122
- return {key: self._quote_expr(value) for key, value in params.items()}
123
- if isinstance(params, tuple):
124
- return tuple(self._quote_expr(p) for p in params)
125
- return [self._quote_expr(p) for p in params]
126
-
127
112
  def _decode(self, param):
128
113
  if PostgresJson and isinstance(param, PostgresJson):
129
114
  # psycopg3
@@ -157,9 +142,7 @@ class NormalCursorMixin(DjDTCursorWrapperMixin):
157
142
  # process during the .last_executed_query() call.
158
143
  self.db._djdt_logger = None
159
144
  try:
160
- return self.db.ops.last_executed_query(
161
- self.cursor, sql, self._quote_params(params)
162
- )
145
+ return self.db.ops.last_executed_query(self.cursor, sql, params)
163
146
  finally:
164
147
  self.db._djdt_logger = self.logger
165
148
 
@@ -4,7 +4,6 @@ from os.path import join, normpath
4
4
 
5
5
  from django.conf import settings
6
6
  from django.contrib.staticfiles import finders, storage
7
- from django.core.checks import Warning
8
7
  from django.utils.functional import LazyObject
9
8
  from django.utils.translation import gettext_lazy as _, ngettext
10
9
 
@@ -178,27 +177,3 @@ class StaticFilesPanel(panels.Panel):
178
177
  if app not in apps:
179
178
  apps.append(app)
180
179
  return apps
181
-
182
- @classmethod
183
- def run_checks(cls):
184
- """
185
- Check that the integration is configured correctly for the panel.
186
-
187
- Specifically look for static files that haven't been collected yet.
188
-
189
- Return a list of :class: `django.core.checks.CheckMessage` instances.
190
- """
191
- errors = []
192
- for finder in finders.get_finders():
193
- try:
194
- for path, finder_storage in finder.list([]):
195
- finder_storage.path(path)
196
- except OSError:
197
- errors.append(
198
- Warning(
199
- "debug_toolbar requires the STATICFILES_DIRS directories to exist.",
200
- hint="Running manage.py collectstatic may help uncover the issue.",
201
- id="debug_toolbar.staticfiles.W001",
202
- )
203
- )
204
- return errors