# HG changeset patch # User Brian Neal # Date 1270000700 0 # Node ID d293b423bdafda18dda7c98e2f16c4c0c8bd1eb6 # Parent a9ea104f49ed7acac6f345fa994de5280f43d72c Adding support for the django debug toolbar. diff -r a9ea104f49ed -r d293b423bdaf gpp/settings.py --- a/gpp/settings.py Wed Mar 31 01:23:57 2010 +0000 +++ b/gpp/settings.py Wed Mar 31 01:58:20 2010 +0000 @@ -73,14 +73,25 @@ )), ) -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', - 'gpp.forums.middleware.WhosOnline', -) +if DEBUG: + MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', + 'gpp.forums.middleware.WhosOnline', + ) +else: + MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', + 'gpp.forums.middleware.WhosOnline', + ) ROOT_URLCONF = 'gpp.urls' @@ -100,7 +111,7 @@ "django.contrib.messages.context_processors.messages", ) -INSTALLED_APPS = ( +INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', @@ -134,7 +145,9 @@ 'shoutbox', 'smiley', 'weblinks', -) +] +if DEBUG: + INSTALLED_APPS.append('debug_toolbar') LOGIN_URL = '/accounts/login/' LOGIN_REDIRECT_URL = '/profile/me/'