Django maintenance panel: show maintenance page only to staff (non-superuser) while allowing superusers and public users.
Project description
django-maintenance-panel
Simple reusable Django app that provides a maintenance mode logic:
- When
maintenance_modeis off: nothing happens. - When
maintenance_modeis on:- Superusers see the site normally.
- Staff (non-superusers) see a maintenance page after login, with a logout button.
- Anonymous users & non-staff users see the site normally.
Local install
Build and install:
python -m pip install --upgrade build
python -m build
pip install .
Django settings
INSTALLED_APPS = [
# ...
"maintenance_panel",
]
MIDDLEWARE = [
# ...
"django.contrib.auth.middleware.AuthenticationMiddleware",
"maintenance_panel.middleware.MaintenanceModeMiddleware",
# ...
]
TEMPLATES = [
{
# ...
"OPTIONS": {
"context_processors": [
# ...
"maintenance_panel.context_processors.maintenance_context",
],
},
},
]
Then:
python manage.py migrate maintenance_panel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_maintenance_panel-0.1.0.tar.gz.
File metadata
- Download URL: django_maintenance_panel-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee6571d6acc823aedac16fd77659879a124e592ff072723a891b408ea2cc341
|
|
| MD5 |
b4a746fc1cd7250de40a284031d7ea56
|
|
| BLAKE2b-256 |
9299479761714ed2b87c40e4e193482882f2856ef1219f8241688f2dd73d164d
|
File details
Details for the file django_maintenance_panel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_maintenance_panel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d35971f69700a393de4624cc9a1bdec31625a0776438d31ca9e8cf7941dd508
|
|
| MD5 |
7e8d68f6071e422fcacb5f093d5fd28a
|
|
| BLAKE2b-256 |
13447af04ae1889e0e7d209bff5624c649896a8a6f6ce6b2568b0a22578ef376
|