From e80d42475524b0e87988bcc88e183d8c25f1aade Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Mon, 7 Oct 2024 13:24:11 -0500 Subject: [PATCH 1/2] fix(dev): render toolbar --- pydotorg/settings/local.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pydotorg/settings/local.py b/pydotorg/settings/local.py index 6525d9837..bc8e6f2fd 100644 --- a/pydotorg/settings/local.py +++ b/pydotorg/settings/local.py @@ -6,6 +6,10 @@ ALLOWED_HOSTS = ['*'] INTERNAL_IPS = ['127.0.0.1'] +DEBUG_TOOLBAR_CONFIG = { + "SHOW_TOOLBAR_CALLBACK" : lambda request: True, +} + # Set the path to the location of the content files for python.org # For example, # PYTHON_ORG_CONTENT_SVN_PATH = '/Users/flavio/working_copies/beta.python.org/build/data' From 83b9773445deeea593cf238483941c44a4a1534f Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Tue, 8 Oct 2024 13:00:54 -0500 Subject: [PATCH 2/2] fix(ci): no toolbar during test runs --- pydotorg/settings/local.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pydotorg/settings/local.py b/pydotorg/settings/local.py index bc8e6f2fd..57cfd5fad 100644 --- a/pydotorg/settings/local.py +++ b/pydotorg/settings/local.py @@ -1,3 +1,5 @@ +import sys + from .base import * import os @@ -6,10 +8,6 @@ ALLOWED_HOSTS = ['*'] INTERNAL_IPS = ['127.0.0.1'] -DEBUG_TOOLBAR_CONFIG = { - "SHOW_TOOLBAR_CALLBACK" : lambda request: True, -} - # Set the path to the location of the content files for python.org # For example, # PYTHON_ORG_CONTENT_SVN_PATH = '/Users/flavio/working_copies/beta.python.org/build/data' @@ -58,9 +56,12 @@ # yui-compressor. # PIPELINE['YUI_BINARY'] = '/usr/bin/java -Xss200048k -jar /usr/share/yui-compressor/yui-compressor.jar' -INSTALLED_APPS += [ - 'debug_toolbar', -] + +if "test" not in sys.argv and DEBUG: + INSTALLED_APPS += ["debug_toolbar"] + DEBUG_TOOLBAR_CONFIG = { + "SHOW_TOOLBAR_CALLBACK": lambda request: True, + } MIDDLEWARE += [ 'debug_toolbar.middleware.DebugToolbarMiddleware',