Mercurial > public > sg101
comparison gpp/settings.py @ 188:d293b423bdaf
Adding support for the django debug toolbar.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 31 Mar 2010 01:58:20 +0000 |
parents | be3fff614b93 |
children | db202792d9f5 |
comparison
equal
deleted
inserted
replaced
187:a9ea104f49ed | 188:d293b423bdaf |
---|---|
71 'django.template.loaders.filesystem.Loader', | 71 'django.template.loaders.filesystem.Loader', |
72 'django.template.loaders.app_directories.Loader', | 72 'django.template.loaders.app_directories.Loader', |
73 )), | 73 )), |
74 ) | 74 ) |
75 | 75 |
76 MIDDLEWARE_CLASSES = ( | 76 if DEBUG: |
77 'django.middleware.common.CommonMiddleware', | 77 MIDDLEWARE_CLASSES = ( |
78 'django.contrib.sessions.middleware.SessionMiddleware', | 78 'django.middleware.common.CommonMiddleware', |
79 'django.contrib.messages.middleware.MessageMiddleware', | 79 'django.contrib.sessions.middleware.SessionMiddleware', |
80 'django.contrib.auth.middleware.AuthenticationMiddleware', | 80 'django.contrib.messages.middleware.MessageMiddleware', |
81 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', | 81 'debug_toolbar.middleware.DebugToolbarMiddleware', |
82 'gpp.forums.middleware.WhosOnline', | 82 'django.contrib.auth.middleware.AuthenticationMiddleware', |
83 ) | 83 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', |
84 'gpp.forums.middleware.WhosOnline', | |
85 ) | |
86 else: | |
87 MIDDLEWARE_CLASSES = ( | |
88 'django.middleware.common.CommonMiddleware', | |
89 'django.contrib.sessions.middleware.SessionMiddleware', | |
90 'django.contrib.messages.middleware.MessageMiddleware', | |
91 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
92 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', | |
93 'gpp.forums.middleware.WhosOnline', | |
94 ) | |
84 | 95 |
85 ROOT_URLCONF = 'gpp.urls' | 96 ROOT_URLCONF = 'gpp.urls' |
86 | 97 |
87 TEMPLATE_DIRS = ( | 98 TEMPLATE_DIRS = ( |
88 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". | 99 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
98 "django.core.context_processors.request", | 109 "django.core.context_processors.request", |
99 "django.core.context_processors.media", | 110 "django.core.context_processors.media", |
100 "django.contrib.messages.context_processors.messages", | 111 "django.contrib.messages.context_processors.messages", |
101 ) | 112 ) |
102 | 113 |
103 INSTALLED_APPS = ( | 114 INSTALLED_APPS = [ |
104 'django.contrib.admin', | 115 'django.contrib.admin', |
105 'django.contrib.admindocs', | 116 'django.contrib.admindocs', |
106 'django.contrib.auth', | 117 'django.contrib.auth', |
107 'django.contrib.contenttypes', | 118 'django.contrib.contenttypes', |
108 'django.contrib.flatpages', | 119 'django.contrib.flatpages', |
132 'polls', | 143 'polls', |
133 'potd', | 144 'potd', |
134 'shoutbox', | 145 'shoutbox', |
135 'smiley', | 146 'smiley', |
136 'weblinks', | 147 'weblinks', |
137 ) | 148 ] |
149 if DEBUG: | |
150 INSTALLED_APPS.append('debug_toolbar') | |
138 | 151 |
139 LOGIN_URL = '/accounts/login/' | 152 LOGIN_URL = '/accounts/login/' |
140 LOGIN_REDIRECT_URL = '/profile/me/' | 153 LOGIN_REDIRECT_URL = '/profile/me/' |
141 LOGOUT_URL = '/accounts/logout/' | 154 LOGOUT_URL = '/accounts/logout/' |
142 | 155 |