diff --git a/sigi/middleware.py b/sigi/middleware.py new file mode 100644 index 0000000..f736951 --- /dev/null +++ b/sigi/middleware.py @@ -0,0 +1,9 @@ +try: + # try use maintenancemode middleware from django-maintenancemode project + import maintenancemode.middleware + class MaintenanceModeMiddleware(maintenancemode.middleware.MaintenanceModeMiddleware): + pass +except ImportError: + # otherwise, a thin wrapper for middleware + class MaintenanceModeMiddleware(object): + pass diff --git a/sigi/settings.py b/sigi/settings.py index 4e91752..bf81d1e 100644 --- a/sigi/settings.py +++ b/sigi/settings.py @@ -64,7 +64,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.gzip.GZipMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'maintenancemode.middleware.MaintenanceModeMiddleware', + 'sigi.middleware.MaintenanceModeMiddleware', 'django.middleware.cache.CacheMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.doc.XViewMiddleware',