Permalink
Browse files

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
  • Loading branch information...
1 parent d59e5cd commit 6e70395050b538ccbd407d5da1317c12419d4a5d lmr committed Jun 23, 2011
Showing with 15 additions and 4 deletions.
  1. +6 −4 frontend/settings.py
  2. +9 −0 global_config.ini
View
@@ -4,8 +4,12 @@
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_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")
View
@@ -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

0 comments on commit 6e70395

Please sign in to comment.