diff --git a/src/rockstor/settings.py b/src/rockstor/settings.py index 232e503e1..d38b2aa56 100644 --- a/src/rockstor/settings.py +++ b/src/rockstor/settings.py @@ -164,7 +164,6 @@ ] MIDDLEWARE = ( - # "debug_toolbar.middleware.DebugToolbarMiddleware", # New in 1.8, 1.11 newly sets Content-Length header. # 'django.middleware.common.CommonMiddleware', "django.contrib.sessions.middleware.SessionMiddleware", @@ -203,7 +202,6 @@ "smart_manager", "oauth2_provider", "huey.contrib.djhuey", - # "debug_toolbar", ) # https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-STORAGES @@ -477,7 +475,7 @@ # DJANGO DEBUG TOOLBAR settings and configuration # recommended NOT to use the toolbar when running tests -# so enable it only when NOT running tests or NOT DEBUG +# so enable it only when in DEBUG mode and NOT running tests TESTING = "test" in sys.argv if (not TESTING) and DEBUG: INSTALLED_APPS = [ diff --git a/src/rockstor/urls.py b/src/rockstor/urls.py index 7542c35d4..4f0b7270f 100644 --- a/src/rockstor/urls.py +++ b/src/rockstor/urls.py @@ -151,6 +151,9 @@ ), ] +# DJANGO DEBUG TOOLBAR +# recommended NOT to use the toolbar when running tests +# so enable it only when in DEBUG mode and NOT running tests if (not settings.TESTING) and settings.DEBUG: from debug_toolbar.toolbar import debug_toolbar_urls