-
Notifications
You must be signed in to change notification settings - Fork 1
Maintenance page
h0pbeat edited this page Oct 26, 2013
·
7 revisions
Using django-maintenancemode.
pip install django-maintenancemode
To enable for the site, add maintenancemode.middleware.MaintenanceModeMiddleware
to MIDDLEWARE_CLASSES
in settings.py.
When enabling the maintenance mode, all but admin-users will receive the 503 error page.
The template 503.html
is used by default to show the maintenance page. A special 503 handler can be assigned by adding handler503 = 'render.views.error_503'
to the root urls.py.
Urls can be whitelisted in MAINTENANCE_IGNORE_URLS
(using regexes). To whitelist the admin login interface add:
MAINTENANCE_IGNORE_URLS = (
r'^.*/admin/$',
)
The ips in INTERNAL_IPS
will not receive the 503 error at all:
INTERNAL_IPS = (
'130.225.93.164',
)
Set MAINTENANCE_MODE = True
in settings.py.