app/settings.py
changeset 2904 395cff83dc83
parent 2896 5a3c5a2f567f
child 2946 69be8ea0b597
--- a/app/settings.py	Sat Sep 12 01:19:23 2009 +0200
+++ b/app/settings.py	Sat Sep 12 01:20:12 2009 +0200
@@ -85,8 +85,21 @@
 #     'django.template.loaders.eggs.load_template_source',
 )
 
+# The order of the middleware is as follows because:
+# - The ValueStore middleware should be before any other middleware
+#   so that the value store is available to it.
+# - The ExceptionHandler should be the outermost handler (after the
+#   ValueStore) so as to catch as many errors as possible.
+# - The Profile middleware should be as outmost as possible, so that
+#   as many function calls as possible, but it cannot be before the
+#   ExceptionHandler (so as to catch exceptions thrown by it).
+# - The MaintenanceMiddleware should be after the Profiler, since we
+#   do want it's actions profiled.
 MIDDLEWARE_CLASSES = (
+    'soc.middleware.value_store.ValueStoreMiddleware',
+    'soc.middleware.exception_handler.ExceptionHandlerMiddleware',
     'app_profiler.app_profiler.ProfileMiddleware',    
+    'soc.middleware.maintenance.MaintenanceMiddleware',
 #    'django.middleware.common.CommonMiddleware',
 #    'django.contrib.sessions.middleware.SessionMiddleware',
 #    'django.contrib.auth.middleware.AuthenticationMiddleware',