From 528e51fc17ca9e90f0b3fa013f50cf985e77978f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 2 Jul 2017 12:51:26 +0200 Subject: settings: add parameter for a debug to console env --- example_project/settings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'example_project') diff --git a/example_project/settings.py b/example_project/settings.py index dceeff0be..778a16610 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -7,6 +7,7 @@ import sys DEBUG = False DEBUG_TOOLBAR = False +DEBUG_TO_CONSOLE = False TEMPLATE_DEBUG = DEBUG SQL_DEBUG = False DJANGO_EXTENSIONS = False @@ -261,7 +262,10 @@ JQUERY_UI_URL = STATIC_URL + "js/jquery-ui/" if DEBUG: # make all loggers use the console for logger in LOGGING['loggers']: - LOGGING['loggers'][logger]['handlers'] += ['console'] + if DEBUG_TO_CONSOLE: + LOGGING['loggers'][logger]['handlers'] = ['console'] + elif 'console' not in LOGGING['loggers'][logger]['handlers']: + LOGGING['loggers'][logger]['handlers'] += ['console'] if DJANGO_EXTENSIONS: INSTALLED_APPS.append('django_extensions') -- cgit v1.2.3