summaryrefslogtreecommitdiff
path: root/example_project
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-07-17 12:27:51 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-07-17 12:28:52 +0200
commit476d48bce40570df3d61d953497f3424cff61fb3 (patch)
treed11c9767cc523298538a89fca877d61cd7c31cd2 /example_project
parent19fcad448d6b0f748cb9585a41f748aea62ab1f3 (diff)
downloadIshtar-476d48bce40570df3d61d953497f3424cff61fb3.tar.bz2
Ishtar-476d48bce40570df3d61d953497f3424cff61fb3.zip
More precise DEBUG management
Diffstat (limited to 'example_project')
-rw-r--r--example_project/settings.py38
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: