Database-driven way to put your Django site into maintenance mode.
Current Version: 1.1.6
This project makes it easy to put your Django site into “maintenance mode”, or more technically, return an HTTP 503 response.
This project differs slightly from other implementations in that the maintenance mode flag is stored in your database versus settings or an environment variable. If your site is deployed to multiple servers, the centralized database-based maintenance flag makes it a snap to bring them all up or down at once.
You must have at least one Site entry in your database before installing django-maintenancemode-2.
– or –
Image of django-maintenancemode-2
To put a site into “Maintenance Mode”, just check the “In Maintenance Mode” checkbox and save in Django Admin under the “Maintenancemode” section. The next time you visit the public side of the site it will return a 503 if:
Just log in, un-check the “In Maintenance Mode” checkbox and save.
A “testproject” application is included which also contains unit and functional tests you can run via python manage.py test from the testproject directory.
You will need to run manage.py syncdb to create the test project database.
There are only two views in the testproject: - / - /ignored-page
To see maintenancemode in action, log into Django admin, and set the maintenance mode to true. Log out, then visit the home page and instead, you’ll be greeted with the maintenance page.
To have maintenancemode ignore the “ignored-page” view, simply add it’s url pattern to the Ignored URLs as:
Now you should be able to visit the ignored-page view regardless of the maintenancemode status. This is useful for contact or help pages that you still want people to be able to access while you’re working on other parts of the site.
Legacy support for South migrations is supported, otherwise manage.py syncdb should add the necessary tables.