From 6fc1b83e94e0a84b87234ddff0c10e978f7e581e Mon Sep 17 00:00:00 2001 From: Tom V Date: Mon, 28 Jul 2025 14:53:21 +0100 Subject: [PATCH 1/2] install django.contrib.staticfiles if missing --- README.md | 4 +++- django_plugin_django_debug_toolbar/__init__.py | 4 +++- pyproject.toml | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7072655..271060f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ pip install django-plugin-django-debug-toolbar Looking at [Django Debug Toolbar's installation instructions](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html), this plugin takes care of the following steps (using their numbering): - [#1. Install the Package](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#install-the-package) +- [#2. Check for Prerequisites](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#check-for-prerequisites) + - setup `django.contrib.staticfiles` - [#3. Install the App](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#install-the-app) - [#4. Add the URLs](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#add-the-urls) - [#5. Add the Middleware](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#add-the-middleware) @@ -35,7 +37,7 @@ Looking at [Django Debug Toolbar's installation instructions](https://django-deb But you still need to: - [#2. Check for Prerequisites](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#check-for-prerequisites) - - like settings for static files and templates + - like settings for templates - [#6. Configure Internal IPs](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#configure-internal-ips) - if you require IPs other than `127.0.0.1`, set them in `INTERNAL_IPS` in your settings - [#7. Disable the toolbar when running tests (optional)](https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#disable-the-toolbar-when-running-tests-optional) diff --git a/django_plugin_django_debug_toolbar/__init__.py b/django_plugin_django_debug_toolbar/__init__.py index 3cc628c..4c53128 100644 --- a/django_plugin_django_debug_toolbar/__init__.py +++ b/django_plugin_django_debug_toolbar/__init__.py @@ -4,7 +4,7 @@ @djp.hookimpl def installed_apps(): - return ["debug_toolbar"] + return ["django.contrib.staticfiles", "debug_toolbar"] @djp.hookimpl @@ -19,6 +19,8 @@ def settings(current_settings): # Debug Toolbar will only display when DEBUG = True current_settings["DEBUG"] = True + current_settings.setdefault("STATIC_URL", "static/") + current_settings["MIDDLEWARE"] = inject_middleware(current_settings["MIDDLEWARE"]) diff --git a/pyproject.toml b/pyproject.toml index fdbea6b..650c6fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,14 @@ test = [ "typos", ] +[build-system] +requires = ["uv_build"] +build-backend = "uv_build" + +[tool.uv.build-backend] +module-root = "" + + [tool.pytest.ini_options] DJANGO_SETTINGS_MODULE = "tests.test_project.settings" pythonpath = ["."] From 08a010cbc7dcafc8e4248114b439d7cd4326af2d Mon Sep 17 00:00:00 2001 From: Tom V Date: Mon, 28 Jul 2025 14:53:38 +0100 Subject: [PATCH 2/2] bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 650c6fb..138f8a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "django-plugin-django-debug-toolbar" -version = "0.4.2" +version = "0.5.1" description = "Django plugin that configures the Django Debug Toolbar" readme = "README.md" authors = [{name = "Tom Viner"}]