Skip to main content

Django app to show system status

Project description

statusboard
===========

`|Build Status| <https://travis-ci.org/edigiacomo/django-statusboard>`_
`|Pypi| <https://pypi.python.org/pypi/django-statusboard/>`_

Status page application.

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

Install the package

::

pip install django-statusboard

Add the following applications to your Django projects

::

INSTALLED_APPS += [
'django.contrib.humanize',
'rest_framework',
'statusboard',
]

Update your urlconf:

::

# myproject/urls.py
urlpatterns += [
url(r'^statusboard/$', include('statusboard.urls')),
]

Update your database

::

./manage migrate

Configuration
-------------

You can configure the app using the dict ``STATUSBOARD`` in
``settings.py``:

::

STATUSBOARD = {
"INCIDENT_DAYS_IN_INDEX": 7,
"OPEN_INCIDENT_IN_INDEX": True,
}

- ``INCIDENT_DAYS_IN_INDEX``: number of days to show in index (1 =
today).
- ``OPEN_INCIDENT_IN_INDEX``: show not fixed incidents in index.

Customize pages
---------------

The following blocks are customizable in ``statusboard/base.html``:

- ``title``: title of the page
- ``branding``: branding in fixed navbar
- ``bootstrap_theme``: bootstrap theme
- ``header``: header of the page
- ``userlinks``: links in the header
- ``footer``: footer div
- ``style``: ``CSS`` files
- ``script``: JavaScript files

Example: change branding and title
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Django 1.8
^^^^^^^^^^

Copy ``statusboard/templates/statusboard/base.html`` in one of your
templates dir and edit the file.

Django >= 1.9
^^^^^^^^^^^^^

In Django >= 1.9, the templates can be extended recursively (see
https://docs.djangoproject.com/en/1.10/releases/1.9/).

Create a ``statusboard/base.html`` in one of your templates dir:

::

{% extends `statusboard/base.html %}

{% block title %}
ACME, Inc.
{% endblock %}

{% block branding %}
<a class="navbar-brand" href="{% url 'statusboard:index' %}">ACME status</a>
{% endblock %}

Notifications
-------------

``django-statusboard`` doesn't provide an out-of-the-box notification
system, but it's easy to implement using `django
signals <https://docs.djangoproject.com/en/dev/topics/signals/>`_.

Moreover, ``django-statusboard`` tracks the previous status of a service
(``Service._status``).

::

from django.dispatch import receiver
from django.db.models.signals import post_save
from django.core.mail import mail_admins

from statusboard import Service

@receiver(post_save, sender=Service)
def notify_service_update(sender, instance, **kwargs):
# Send an email to admins if the service is getting worse, otherwise do nothing.
if instance.status > instance._status:
mail_admins("Alert",
"Service {} is {}".format(instance.name, instance.get_status_display()))

.. |Build
Status| image:: https://travis-ci.org/edigiacomo/django-statusboard.svg?branch=master
.. |Pypi| image:: https://img.shields.io/pypi/v/django-statusboard.svg

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-statusboard-0.4.tar.gz (208.6 kB view details)

Uploaded Source

File details

Details for the file django-statusboard-0.4.tar.gz.

File metadata

File hashes

Hashes for django-statusboard-0.4.tar.gz
Algorithm Hash digest
SHA256 6a581f89025347ea599b54011bd80e79b9bbc4a5e092d9c3e90ee828602379ba
MD5 b3b39c7ce3fcdd1d510aaa783781ddaa
BLAKE2b-256 6e1fe6e3cae330041f05f0a0da185dbef1efcb0beb538faba149b7c0025df861

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