Browse Source

Criado um wrapper para quem não possui a app django-maintenancemode instalada.

0.2
Guilherme Gondim 16 years ago
parent
commit
5198de65b5
  1. 9
      sigi/middleware.py
  2. 2
      sigi/settings.py

9
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

2
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',

Loading…
Cancel
Save