Package: tocka-django-maintenancemode
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, andusers visiting the site from an ip address defined in Django’sINTERNAL_IPS.The two points above are just the defaults, configured inPERMISSION_PROCESSORSsetting
(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 urls.py
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 settings.py
and into your database.Requirementsdjango.contrib.sitesSites must have at least one domain to work properly.Plugin is fully tested with:Django 1.7.8Django 1.8.2Python 2.7.9Python 3.4.2InstallationInstall usingpip install tocka-django-maintenancemodeOr if you no like pip: download the source andpython setup.py installIn your Django settings file add maintenancemode to yourMIDDLEWARE_CLASSES.
Make sure it comes after Django’s AuthenticationMiddleware. Like so:MIDDLEWARE_CLASSES = (
    # ...

    'maintenancemode.middleware.MaintenanceModeMiddleware',
)Addmaintenancemodeto yourINSTALLED_APPS.Run manage.py 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.ConfigurationConfig section is not up-to-date :(MAINTENANCE MODEMaintenance 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 settings.pyMAINTENANCE IGNORE URLSPatterns 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.Tododocument configurationdocument permission processorssort out the ignored urls featuretests for admin interface?pypi packageomg make this readme in markdownChanges
== == == =developement
- - - - - - - - - - - -0.9.4
- - - - -
- Tests for changes from 0.9.3
- Django 1.7 and 1.8 compatibility
- Pluggable permissions schema0.9.3
- - - - -
- Moved maintenance mode and ignored url patterns from settings.py to database backed storage.0.9.2
- - - - -
- Fixed an issue with setuptools, thanks for reporting this ksato97000.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 buildoutThe middleware now uses its own default config file, thanks to a patch by sementeUse INTERNAL_IPS to check for users that need access. user.is_staff will stay in place for backwards incompatibility. Thanks for the idea Joshua WorksHave setup.py sdist only distribute maintenancemode itself, no longer distribute tests and buildout stuffUse README and CHANGES in setup.py’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