diff options
Diffstat (limited to 'example_project')
| -rw-r--r-- | example_project/settings.py | 38 | 
1 files changed, 22 insertions, 16 deletions
| diff --git a/example_project/settings.py b/example_project/settings.py index 0aaeb306d..4930d6efa 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -4,6 +4,9 @@  import os +DEBUG = False +DEBUG_TOOLBAR = False +TEMPLATE_DEBUG = DEBUG  SQL_DEBUG = False  ROOT_PATH = os.path.abspath(os.path.curdir) + os.path.sep @@ -18,8 +21,6 @@ XHTML2ODT_PATH = ROOT_PATH + "../xhtml2odt"  ODT_TEMPLATE = ROOT_PATH + "../ishtar_common/static/template.odt"  LOGIN_REDIRECT_URL = "/" + URL_PATH -DEBUG = 1 -TEMPLATE_DEBUG = DEBUG  AUTH_PROFILE_MODULE = 'ishtar_common.IshtarUser'  ACCOUNT_ACTIVATION_DAYS = 7 @@ -65,14 +66,13 @@ TEMPLATE_LOADERS = (  #     'django.template.loaders.eggs.Loader',  ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE_CLASSES = [      'django.middleware.common.CommonMiddleware',      'django.contrib.sessions.middleware.SessionMiddleware',      'django.middleware.csrf.CsrfViewMiddleware',      'django.contrib.auth.middleware.AuthenticationMiddleware',      'django.contrib.messages.middleware.MessageMiddleware', -    #'debug_toolbar.middleware.DebugToolbarMiddleware', -) +]  TEMPLATE_CONTEXT_PROCESSORS = (      'ishtar_common.context_processors.get_base_context', @@ -187,17 +187,23 @@ INSTALLED_APPS += EXTRA_APPS  INTERNAL_IPS = ('127.0.0.1',) -DEBUG_TOOLBAR_PANELS = ( -    'debug_toolbar.panels.version.VersionDebugPanel', -    'debug_toolbar.panels.timer.TimerDebugPanel', -    'debug_toolbar.panels.headers.HeaderDebugPanel', -    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', -    'debug_toolbar.panels.sql.SQLDebugPanel', -    'debug_toolbar.panels.cache.CacheDebugPanel', -    'debug_toolbar.panels.logger.LoggingPanel', -) - -DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS':False} +if DEBUG_TOOLBAR: +    global DEBUG_TOOLBAR_PANELS +    global DEBUG_TOOLBAR_CONFIG +    MIDDLEWARE_CLASSES += ['debug_toolbar.middleware.DebugToolbarMiddleware'] +    INSTALLED_APPS += ['debug_toolbar'] +    DEBUG_TOOLBAR_PANELS = ( +        'debug_toolbar.panels.version.VersionDebugPanel', +        'debug_toolbar.panels.timer.TimerDebugPanel', +        'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', +        'debug_toolbar.panels.headers.HeaderDebugPanel', +        'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', +        'debug_toolbar.panels.template.TemplateDebugPanel', +        'debug_toolbar.panels.sql.SQLDebugPanel', +        'debug_toolbar.panels.signals.SignalDebugPanel', +        'debug_toolbar.panels.logger.LoggingPanel', +    ) +    DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS':False}  import sys  if 'test' in sys.argv or 'test_coverage' in sys.argv: | 
