Skip to main content

Django-maintenancemode allows you to temporary shutdown your site for maintenance work

Project description

django-maintenancemode is a middleware that allows you to temporary shutdown your site for maintenance work.

When site is in maintenance mode, some user can still access the regular site:
  • logged in users having staff credentials, and
  • users visiting the site from an ip address defined in Django’s INTERNAL_IPS.

The two points above are just the defaults, configured in PERMISSION_PROCESSORS setting (see below). Custom rules are easy to plug in.

django-maintenancemode works the same way as handling 404 or 500 errors in Django work. It adds a handler503 which you can override in your main or you can add a 503.html to your templates directory.

Forking history:
  • This fork adds the permission processors framework.
  • Older fork moved the maintenance mode property and ignored urls out of and into your database.



Sites must have at least one domain to work properly.

Plugin is fully tested with:
  • Django 1.7.8
  • Django 1.8.2
  • Python 2.7.9
  • Python 3.4.2


  • Install using pip install tocka-django-maintenancemode

  • Or if you no like pip: download the source and python install

  • In your Django settings file add maintenancemode to your MIDDLEWARE_CLASSES. Make sure it comes after Django’s AuthenticationMiddleware. Like so:

        # ...
  • Add maintenancemode to your INSTALLED_APPS.

  • Run migrate to create the necessary tables.

  • Adding the middleware and running your site creates the necessary records in the database to enable/disable maintenance mode and ignored URL patterns.


Config section is not up-to-date :(


Maintenance mode will create a database record per site, read from the domains you have in the Sites app. There is a boolean property on each Maintenance model, “is_being_performed” that takes the place of putting the site into “maintnenace mode” from


Patterns to ignore are registered as an inline model for each maintenance record created when the site is first run. Patterns should begin with a forward slash: /, but can end any way you’d like.


  • document configuration
  • document permission processors
  • sort out the ignored urls feature
  • tests for admin interface?
  • pypi package
  • omg make this readme in markdown

Changes == == == =

developement - - - - - - - - - - - -

0.9.4 - - - - - - Tests for changes from 0.9.3 - Django 1.7 and 1.8 compatibility - Pluggable permissions schema

0.9.3 - - - - - - Moved maintenance mode and ignored url patterns from to database backed storage.

0.9.2 - - - - - - Fixed an issue with setuptools, thanks for reporting this ksato9700

0.9.1 - - - - -

  • Tested django - maintenancemode with django - 1.0 release (following the 1.0.X release branch)
  • Bundled buildout.cfg and bootstrap with the source version of the project, allowing repeatable buildout
  • The middleware now uses its own default config file, thanks to a patch by semente
  • Use INTERNAL_IPS to check for users that need access. user.is_staff will stay in place for backwards incompatibility. Thanks for the idea Joshua Works
  • Have sdist only distribute maintenancemode itself, no longer distribute tests and buildout stuff
  • Use README and CHANGES in’s long_description, stolen from Jeroen’s djangorecipe :)
  • Updated the documentation and now use pypi as the documentation source (link there from google code)

0.9 - - - - -

First release

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tocka-django-maintenancemode, version
Filename, size File type Python version Upload date Hashes
Filename, size tocka-django-maintenancemode- (6.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page