From 3de21d9c41493dc0dbdb4a4dca32a34303f1d956 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 28 Aug 2025 10:24:29 -0400 Subject: [PATCH] test: Disable the Django Debug Toolbar by default. Disable the toolbar by default but make it easy to turn back on as needed. This is in response to the discussion here: https://discuss.openedx.org/t/lets-remove-django-debug-toolbar/16847 --- lms/envs/devstack.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 20bdba0d7d..8f25169cbd 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -22,6 +22,8 @@ ORA2_FILEUPLOAD_BACKEND = 'django' DEBUG = True +INTERNAL_IPS = ('127.0.0.1',) + USE_I18N = True DEFAULT_TEMPLATE_ENGINE['OPTIONS']['debug'] = True LMS_BASE = 'localhost:18000' @@ -81,13 +83,14 @@ DJFS = { ################################ DEBUG TOOLBAR ################################ -INSTALLED_APPS += ['debug_toolbar'] -MIDDLEWARE += [ - 'lms.djangoapps.discussion.django_comment_client.utils.QueryCountDebugMiddleware', - 'debug_toolbar.middleware.DebugToolbarMiddleware', -] - -INTERNAL_IPS = ('127.0.0.1',) +# The Django Debug Toolbar is disabled by default, if you need to enable it for +# debugging. Simply uncomment the INSTALLED_APPS and MIDDLEWARE section below. +# +# INSTALLED_APPS += ['debug_toolbar'] +# MIDDLEWARE += [ +# 'lms.djangoapps.discussion.django_comment_client.utils.QueryCountDebugMiddleware', +# 'debug_toolbar.middleware.DebugToolbarMiddleware', +# ] DEBUG_TOOLBAR_PANELS = ( 'debug_toolbar.panels.versions.VersionsPanel',