class RedirectMiddleware(object):
+ def __init__(self, get_response):
+ self.get_response = get_response
+
+ def __call__(self, request):
+ return self.get_response(request)
+
def process_exception(self, request, exception):
if isinstance(exception, ERedirect):
return shortcuts.redirect(exception.url)
# Make this unique, and don't share it with anybody.
SECRET_KEY = '7j9q&&!g26rkh!=g%1zb@20b^k^gmzy4=!mhzu2wesxb9b%16m'
-MIDDLEWARE_CLASSES = [
+MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
]
# If this is a non-public site, enable middleware for handling logins etc
if ALLOW_RESEND or not PUBLIC_ARCHIVES:
- MIDDLEWARE_CLASSES = [
+ MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
- ] + MIDDLEWARE_CLASSES
- MIDDLEWARE_CLASSES.append('archives.mailarchives.redirecthandler.RedirectMiddleware')
+ ] + MIDDLEWARE
+ MIDDLEWARE.append('archives.mailarchives.redirecthandler.RedirectMiddleware')
INSTALLED_APPS = [
'django.contrib.sessions',