remove: Django Debug Toolbar from development setup
Removed django-debug-toolbar as it's unnecessary for API-only setup: - Removed from INSTALLED_APPS and MIDDLEWARE in local.py - Removed from dev dependencies in pyproject.toml - Updated uv.lock after package removal The debug toolbar was interfering with API documentation pages and provides minimal value for a primarily API-based application. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -88,40 +88,9 @@ EMAIL_BACKEND = env(
|
||||
# INSTALLED_APPS = ["whitenoise.runserver_nostatic", *INSTALLED_APPS]
|
||||
|
||||
|
||||
# django-debug-toolbar
|
||||
# django-debug-toolbar - REMOVED
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
|
||||
INSTALLED_APPS += ["debug_toolbar"]
|
||||
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware
|
||||
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
|
||||
# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
|
||||
|
||||
|
||||
def show_toolbar(request):
|
||||
"""Hide debug toolbar on API documentation pages."""
|
||||
# Hide on Swagger/ReDoc API documentation
|
||||
if request.path.startswith("/v1/"):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
DEBUG_TOOLBAR_CONFIG = {
|
||||
"DISABLE_PANELS": [
|
||||
"debug_toolbar.panels.redirects.RedirectsPanel",
|
||||
# Disable profiling panel due to an issue with Python 3.12+:
|
||||
# https://github.com/jazzband/django-debug-toolbar/issues/1875
|
||||
"debug_toolbar.panels.profiling.ProfilingPanel",
|
||||
],
|
||||
"SHOW_TEMPLATE_CONTEXT": True,
|
||||
"SHOW_TOOLBAR_CALLBACK": show_toolbar,
|
||||
}
|
||||
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
|
||||
INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
|
||||
if env("USE_DOCKER") == "yes":
|
||||
import socket
|
||||
|
||||
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
||||
INTERNAL_IPS += [".".join([*ip.split(".")[:-1], "1"]) for ip in ips]
|
||||
# Debug toolbar removed as this is an API-only setup
|
||||
|
||||
# django-extensions
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
@@ -133,7 +133,6 @@ force-single-line = true
|
||||
dev = [
|
||||
"coverage==7.12.0",
|
||||
"django-coverage-plugin==3.2.0",
|
||||
"django-debug-toolbar==6.1.0",
|
||||
"django-extensions==4.1",
|
||||
"django-stubs[compatible-mypy]==5.2.7",
|
||||
"djangorestframework-stubs==3.16.5",
|
||||
|
||||
15
smoothschedule/uv.lock
generated
15
smoothschedule/uv.lock
generated
@@ -720,19 +720,6 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/14/ff/2c7a4b6706125a17bd0071802e4894c28772cfcdea20a086a2be3c5fafda/django_csp-3.8-py3-none-any.whl", hash = "sha256:19b2978b03fcd73517d7d67acbc04fbbcaec0facc3e83baa502965892d1e0719", size = 17410, upload-time = "2024-03-01T14:00:28.135Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "django-debug-toolbar"
|
||||
version = "6.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "django" },
|
||||
{ name = "sqlparse" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c0/50/acae2dd379164f6f4c6b6b36fd48a4d21b02095a03f4df7c30a8d1f1a62c/django_debug_toolbar-6.1.0.tar.gz", hash = "sha256:e962ec350c9be8bdba918138e975a9cdb193f60ec396af2bb71b769e8e165519", size = 309141, upload-time = "2025-10-30T19:50:39.458Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/72/685c978af45ad08257e2c69687a873eda6b6531c79b6e6091794c41c5ff6/django_debug_toolbar-6.1.0-py3-none-any.whl", hash = "sha256:e214dea4494087e7cebdcea84223819c5eb97f9de3110a3665ad673f0ba98413", size = 269069, upload-time = "2025-10-30T19:50:37.71Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "django-environ"
|
||||
version = "0.12.0"
|
||||
@@ -2235,7 +2222,6 @@ dependencies = [
|
||||
dev = [
|
||||
{ name = "coverage" },
|
||||
{ name = "django-coverage-plugin" },
|
||||
{ name = "django-debug-toolbar" },
|
||||
{ name = "django-extensions" },
|
||||
{ name = "django-stubs", extra = ["compatible-mypy"] },
|
||||
{ name = "djangorestframework-stubs" },
|
||||
@@ -2301,7 +2287,6 @@ requires-dist = [
|
||||
dev = [
|
||||
{ name = "coverage", specifier = "==7.12.0" },
|
||||
{ name = "django-coverage-plugin", specifier = "==3.2.0" },
|
||||
{ name = "django-debug-toolbar", specifier = "==6.1.0" },
|
||||
{ name = "django-extensions", specifier = "==4.1" },
|
||||
{ name = "django-stubs", extras = ["compatible-mypy"], specifier = "==5.2.7" },
|
||||
{ name = "djangorestframework-stubs", specifier = "==3.16.5" },
|
||||
|
||||
Reference in New Issue
Block a user