diff options
author | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2011-06-23 14:59:04 +0000 |
---|---|---|
committer | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2011-06-23 14:59:04 +0000 |
commit | 6e70395050b538ccbd407d5da1317c12419d4a5d (patch) | |
tree | a93540337631fd76150c666edd09eba6e65f230c | |
parent | d59e5cdc9c0e10f5fc2ff24f03d3a22b9759de58 (diff) |
web: Turn django debug mode in global_config.ini options
With the change to Django 1.3, DEBUG=True in settings.ini
will make the queries performed by the ORM subsystem to be
printed, hence the scheduler logs will contain those queries.
As this is too much verbosity for 'production' autotest
servers, turned DEBUG and DEBUG_TEMPLATE django config
variables into configurable options on global_config.ini.
The options were explained, and DEBUG is set to False by
default.
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@5446 592f7852-d20e-0410-864c-8624ca9c26a4
-rw-r--r-- | frontend/settings.py | 10 | ||||
-rw-r--r-- | global_config.ini | 9 |
2 files changed, 15 insertions, 4 deletions
diff --git a/frontend/settings.py b/frontend/settings.py index 8497cf2c..6bd5f6f2 100644 --- a/frontend/settings.py +++ b/frontend/settings.py @@ -4,8 +4,12 @@ import os import common from autotest_lib.client.common_lib import global_config -DEBUG = True -TEMPLATE_DEBUG = DEBUG +c = global_config.global_config +_section = 'AUTOTEST_WEB' + +DEBUG = c.get_config_value(_section, "sql_debug_mode", type=bool, default=False) +TEMPLATE_DEBUG = c.get_config_value(_section, "template_debug_mode", type=bool, + default=False) FULL_ADMIN = False @@ -21,8 +25,6 @@ DATABASE_ENGINE = 'autotest_lib.frontend.db.backends.afe' DATABASE_PORT = '' # Set to empty string for default. # Not used with sqlite3. -c = global_config.global_config -_section = 'AUTOTEST_WEB' DATABASE_HOST = c.get_config_value(_section, "host") # Or path to database file if using sqlite3. DATABASE_NAME = c.get_config_value(_section, "database") diff --git a/global_config.ini b/global_config.ini index 2aee0786..51f660a4 100644 --- a/global_config.ini +++ b/global_config.ini @@ -17,6 +17,15 @@ min_retry_delay: 20 max_retry_delay: 60 graph_cache_creation_timeout_minutes: 10 parameterized_jobs: False +# Whether to enable django template debug mode. If this is set to True, all +# django errors will be wrapped in a nice debug page with detailed environment +# and stack trace info. Turned off by default. +template_debug_mode: False +# Whether to enable django SQL debug mode. If this is set to True, all +# queries performed by the Object Relational Mapper subsystem will be printed, +# which means the scheduler logs will contains all the queries executed. This +# is too much verbosity for 'production' systems, hence turned off by default. +sql_debug_mode: False [TKO] host: localhost |