skillfed

django-maintenance-mode

shows a 503 error page when maintenance-mode is on.

django-maintenance-mode v0.23.0 278.1K downloads/30d#8,138 on PyPI526
Permissive license Active released

What it is and what it does

django-maintenance-mode is a Django middleware that intercepts requests and returns a 503 Service Unavailable response when maintenance mode is enabled. It operates at the application level without touching the database or requiring the server to restart, making it suitable for planned downtime, deployments, or migrations. The middleware can be configured to exclude specific users (staff, superusers, authenticated), IP addresses, or URL patterns, and supports multiple state backends (local file, cache, storage) to track whether maintenance mode is active.

The package is designed for developers who need to take their Django site offline temporarily while keeping the application running. It handles response customization (HTML or JSON), redirect URLs, retry headers, and context processors for template rendering. Configuration is entirely optional—sensible defaults apply if not specified—and the middleware can be positioned in the stack to control which other middleware executes during maintenance.

Use it for:

  • Display a maintenance page during database migrations or schema updates without restarting the application.
  • Temporarily take a site offline for emergency fixes or deployments while keeping the server process running.
  • Allow staff and superusers to continue accessing the admin site or specific URLs while other users see the maintenance page.
  • Return JSON responses for API endpoints during maintenance while serving HTML to web browsers.
  • Redirect users to an external status page or alternative URL during planned downtime.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Activates a 503 maintenance page in Django applications without requiring database access or stopping the application server.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a common operational need in Django deployments. The permissive MIT license and broad Django version support (4.2 through 6.0) make it a safe choice for most projects. Install it if you need to take your site offline without restarting the server.

Install

django-maintenance-mode on PyPI

pip

pip install django-maintenance-mode

uv

uv add django-maintenance-mode

poetry

poetry add django-maintenance-mode

Installing django-maintenance-mode

Before you install

Low install friction with a single wheel distribution. Actively maintained with a recent release (31 days old) and consistent commit activity. Depends only on django and python-fsutil.

License in practice

MIT license (permissive) allows commercial and private use with minimal restrictions.

Quickstart

pip install django-maintenance-mode

# In settings.py:
INSTALLED_APPS = [
    'maintenance_mode',
    # ...
]

MIDDLEWARE = [
    # ...
    'maintenance_mode.middleware.MaintenanceModeMiddleware',
]

# Create templates/503.html, then toggle:
MAINTENANCE_MODE = True

Requires a custom 503.html template in your templates directory; middleware position matters for which middleware executes during maintenance mode.

Verify before relying

  • Whether python-fsutil has any known issues or maintenance concerns not reflected in this package's security record.
  • Whether the local file backend state file is safe for concurrent writes in multi-process deployments.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — django, python-fsutil
Maintenance actively maintained — 31 days since the last release
Last repo commit
First released
Downloads 278,084/month — #8,138 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_maintenance_mode-0.23.0-py3-none-any.whl

Keywords: django, maintenance, mode, offline, under, 503, service, temporarily, unavailable

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Build Tools

Tags

django maintenance mode503 error page djangodjango offline modedjango service unavailabledjango downtime pagedjango maintenance middlewaretoggle maintenance page django
django-middlewaredeployment-ops

More Build Tools packages