Skip to main content
Django 503
==========

An app to show 503 error page, while your django site is on maintenance.

Sometimes you just need to temporarily stop your site to do some maintenance,
maybe to run migrations, update packages, or something like that. Quick and easy solution is to set up
a 503 error page for all requests. It should show human-friendly text for your site visitors,
saying that site will be back online very soon, while you're working on it at the moment.
After maintenance is over you can promptly turn 503 error page off.

``503 Service Unavailable`` is a valid http response:

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.
The implication is that this is a temporary condition which will be alleviated after some delay.

It works well with search engine crawlers, your page index will stay intact if your maintenance doesn't last far too long.

Installation
------------

Django-503 works with python>=2.5 and django>=1.2
Recommended way to install is pip::

pip install django-503


* Add ``django_503`` to ``INSTALLED_APPS`` in settings.py::

INSTALLED_APPS = (...
'django_503',
...
)

* Add ``'django_503.middleware.MaintenanceMiddleware'`` to your ``MIDDLEWARE_CLASSES``
after session and auth middlewares like this::

MIDDLEWARE_CLASSES = (
...
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
...
'django_503.middleware.MaintenanceMiddleware',
)

* Run ``python manage.py syncdb``

* Make sure you use ``admin.autodiscover()`` to enable project ``admin.py``.

Usage
-----

You can turn on maintenance mode by changing app config via django admin interface.
It's located at url ``/admin/django_503/config/`` relative your site URL .
Setting `mainteneance` to True will turn 503 error page for regular users.
Admins will see a warning on top of every html page, stating site is on maintenance now,
so that they can still access site and not forget to switch 503 mode off.


Template overriding
~~~~~~~~~~~~~~~~~~~
* To change 503 error page looks you should override ``503.html`` template.
* To change admin warning message you should override ``admin_warning.html`` template.

Tests
-----

To run app testsuite use::

python setup.py test django-503

Release files for django-503 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-503 0.1
File Size Uploaded
django-503-0.1.tar.gz 5.4 kB Details

Release files / django-503-0.1.tar.gz

Download URL django-503-0.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c39f5caed7559cff1ab9c0720c4cd18b86ea221de7dfeb5b886fed58f7bfef1d
BLAKE2b-256 checksum
How to use checksums
66c2b6d5278dcc8e2aff1f9ae48511a0b09e6ded253ec0e383773d285756a84e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page