diff --git a/cmsmanage/settings.py b/cmsmanage/settings.py index d83c33f..5fb5e0e 100644 --- a/cmsmanage/settings.py +++ b/cmsmanage/settings.py @@ -1,4 +1,5 @@ import os +import sys from pathlib import Path from django.core import validators @@ -303,8 +304,15 @@ class Dev(NonCIBase): DEBUG = values.BooleanValue(True) INTERNAL_IPS = ["127.0.0.1"] - INSTALLED_APPS = NonCIBase.INSTALLED_APPS + ["debug_toolbar", "django_extensions"] - MIDDLEWARE = ["debug_toolbar.middleware.DebugToolbarMiddleware"] + Base.MIDDLEWARE + INSTALLED_APPS = NonCIBase.INSTALLED_APPS + ["django_extensions"] + + # bit of a hack to disable debug toolbar when running tests + if DEBUG and "test" not in sys.argv: + INSTALLED_APPS += ["debug_toolbar"] + MIDDLEWARE = NonCIBase.MIDDLEWARE + [ + "debug_toolbar.middleware.DebugToolbarMiddleware", + ] + EMAIL = values.EmailURLValue("smtp://localhost:1025") # for local `mailpit` SENDFILE_BACKEND = "django_sendfile.backends.development"