Skip to main content

Enterprise Grade Maintenance Mode Management for Django Applications

Project description

Latest on Django Packages

Django Enterprise Maintenance Suite

Enterprise Maintenance Suite is a Django reusable application that provides enterprise-grade maintenance control such as:

  • Full Maintenance Mode (503)
  • Read-Only Mode (No Writes)
  • Admin approval workflow
  • Time-based maintenance windows
  • Audit logging

This package is intended to be installed via pip and plugged directly into any existing Django project.


Features

  • Full system maintenance (HTTP 503)
  • Read-only mode (blocks POST / PUT / PATCH / DELETE)
  • Admin-controlled enable / disable
  • Approval workflow
  • Time-window based activation
  • Middleware based request interception
  • Audit trail for maintenance actions
  • Production-ready Django app

Installation

1. Install Package from PyPI

pip install django_enterprise_maintenance_suite

2. Add to INSTALLED_APPS

INSTALLED_APPS = [
    ...
    "django_enterprise_maintenance_suite",
    ...
]

3. Add Middleware

MIDDLEWARE = [
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django_enterprise_maintenance_suite.middleware.MaintenanceMiddleware',
]

4. Add to settings.py

MAINTENANCE_SUITE = {
    'ADMIN_URL_NAME': 'admin:index',
    'MAINTENANCE_TEMPLATE': '503.html',
    'READ_ONLY_ALLOWED_METHODS': ["GET", "HEAD"],
}

5. Run Migrations

python manage.py migrate

6. Add to urls.py

from django.urls import path, include

urlpatterns = [
    ...
    path("maintenance/", include("django_enterprise_maintenance_suite.urls")),
]

7. Create SuperUser

python manage.py createsuperuser

Requirements

  • Python 3.9+
  • Django 4.2+

How It Works

  1. Incoming requests pass through MaintenanceMiddleware
  2. Active maintenance window is evaluated
  3. Mode is applied:
    • Maintenance Mode → HTTP 503
    • Read-Only Mode → Blocks write methods
  4. Admin URLs are ignored by default

Maintenance Modes

Full Maintenance Mode

  • Blocks all requests
  • Returns 503 Service Unavailable
  • Intended for deployments & outages

Read-Only Mode

  • Allows safe HTTP methods
  • Blocks:
    • POST
    • PUT
    • PATCH
    • DELETE
  • Returns 403 Forbidden

Admin Panel Usage

The Django Admin allows you to:

  • Create maintenance windows
  • Enable / disable maintenance
  • Approve or reject maintenance
  • Track audit logs

Custom 503 Page

To override the default maintenance page, create: templates/503.html Django will automatically use this template.

Use Cases

  • Production deployments
  • Database migrations
  • Emergency maintenance
  • Compliance-driven outages
  • Enterprise change management

Supporting

License

Licensed under the MIT License. Copyright © 2026 TS Tamarai Selvan Copy of the license.

Project details


Download files

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

Source Distribution

django_enterprise_maintenance_suite-1.0.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django_enterprise_maintenance_suite-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django_enterprise_maintenance_suite-1.0.1.tar.gz
Algorithm Hash digest
SHA256 44e82832f221fb7967718b227927c9a970de4151c80ba8853b877dae92b491ea
MD5 6ed2561bd21a3498d280245f2e7c01e7
BLAKE2b-256 1d94f85def87aa9272e9fa877c99d97b271d0c78a4f6b4c90d14b7ca5d0bf615

See more details on using hashes here.

File details

Details for the file django_enterprise_maintenance_suite-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_enterprise_maintenance_suite-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 876da047d54decb12ebd5e48e354ad8a8278562720191960290c6bd3d1eea192
MD5 aebb508dcdcb6a559a6422101b357cc3
BLAKE2b-256 1d69b0a933200814096c1c3025c10c9719c8c9317ae5d4c41fd4957becf663d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page