From b79b7f7a45f9ae654b6ba1ebe9a71e2a266e0d5b Mon Sep 17 00:00:00 2001 From: Aaron Oppenheimer Date: Sat, 11 May 2024 14:23:16 -0400 Subject: [PATCH] added django debug toolbar --- go3/settings.py | 10 ++++++++++ go3/urls.py | 1 + requirements.txt | 1 + 3 files changed, 12 insertions(+) diff --git a/go3/settings.py b/go3/settings.py index 35d55b41..d7568bf0 100644 --- a/go3/settings.py +++ b/go3/settings.py @@ -90,6 +90,7 @@ "agenda.apps.AgendaConfig", "stats.apps.StatsConfig", "widget_tweaks", + "debug_toolbar", "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", @@ -116,6 +117,7 @@ "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "go3.rollbar_middleware.GigORollbarNotifierMiddleware", + "debug_toolbar.middleware.DebugToolbarMiddleware", ] ROOT_URLCONF = "go3.urls" @@ -340,3 +342,11 @@ ]), } } + +INTERNAL_IPS = [ + "127.0.0.1", +] + +DEBUG_TOOLBAR_CONFIG = { + "ROOT_TAG_EXTRA_ATTRS": "hx-preserve" +} \ No newline at end of file diff --git a/go3/urls.py b/go3/urls.py index 70283f91..11d2a336 100644 --- a/go3/urls.py +++ b/go3/urls.py @@ -55,6 +55,7 @@ path('migration/', include('migration.urls')), path('graphql', PrivateGraphQLView.as_view(graphiql=True, schema=schema)), path('404',test404.as_view()), + path("__debug__/", include("debug_toolbar.urls")), path('jsi18n/', JavaScriptCatalog.as_view(), name="javascript-catalog"), # Backward compatibility with old GO2 cal feed path('cal/m/', go2_id_calfeed), diff --git a/requirements.txt b/requirements.txt index 9535eda7..6ca0e1c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ decorator==5.0.9 dill==0.3.8 Django==4.2.11 django-crispy-forms==1.12.0 +django-debug-toolbar==4.3.0 django-environ==0.11.2 django-extensions==3.1.3 django-markdownify==0.9.3