Package: django-statusboard
statusboardStatus page application with browser and REST API interface.InstallationInstall the packagepipinstalldjango-statusboardAdd the following applications to your Django projectsINSTALLED_APPS+=['django.contrib.humanize','django.contrib.staticfiles','rest_framework','statusboard',]Update your urlconf:# myproject/urls.pyurlpatterns+=[url(r'^statusboard/$',include('statusboard.urls')),]Update your database./managemigrateConfigurationYou can configure the app using the dictSTATUSBOARDinsettings.py:fromdjango.templatetags.staticimportstaticSTATUSBOARD={"INCIDENT_DAYS_IN_INDEX":7,"OPEN_INCIDENT_IN_INDEX":True,"AUTO_REFRESH_INDEX_SECONDS":0,"FAVICON_DEFAULT":static('statusboard/images/statusboard-icon-default.png'),"FAVICON_INDEX_DICT":{0:static('statusboard/images/statusboard-icon-operational.png'),1:static('statusboard/images/statusboard-icon-performance.png'),2:static('statusboard/images/statusboard-icon-partial.png'),3:static('statusboard/images/statusboard-icon-major.png'),},}INCIDENT_DAYS_IN_INDEX: number of days to show in index (1 = today).OPEN_INCIDENT_IN_INDEX: show not fixed incidents in index, whether or not
the incident is older thanINCIDENT_DAYS_IN_INDEX.AUTO_REFRESH_INDEX_SECONDS: auto refresh home page every N seconds (0 = disabled).FAVICON_DEFAULT: default favicon.FAVICON_INDEX_DICT: favicon for index, based on the worst status (default:FAVICON_DEFAULT). The keys(0, 1, 2, 3)are the status values (seeSERVICE_STATUSESinstatusboard/models.py).Customize pagesThe following blocks are customizable instatusboard/base.html:title: title of the pagebranding: branding in fixed navbarbootstrap_theme: bootstrap themeheader: header of the pageuserlinks: links in the headerfooter: footer divstyle:CSSfilesscript: JavaScript filesTo customize the default style, create the filestatusboard/base.htmlthat
extends the original base template and customize some blocks, e.g.:{% extends "statusboard/base.html" %}

{% load static %}

{% block title %}
A.C.M.E. statuspage
{% endblock %}

{% block branding %}
<a class="navbar-brand" href="{% url 'statusboard:index' %}"><img src="{% static "/images/logo.png" %}"></a>
{% endblock %}

{% block bootstrap_theme %}
<link rel="stylesheet" href="{% static "/statusboard/css/spacelab-bootstrap.min.css" %}" />
<link rel="stylesheet" href="{% static "/css/mystyle.css" %}" />
{% endblock %}Example: change branding and titleCreate astatusboard/base.htmlin 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 %}Notificationsdjango-statusboarddoesn't provide an out-of-the-box notification system, but
it's easy to implement usingdjango signalsor you can usedjango-statusboard-notifythat provides some builtin notifications (e.g. email, Telegram).Moreover,django-statusboardtracks the previous status of a service
(Service._status).fromdjango.dispatchimportreceiverfromdjango.db.models.signalsimportpost_savefromdjango.core.mailimportmail_adminsfromstatusboardimportService@receiver(post_save,sender=Service)defnotify_service_update(sender,instance,**kwargs):# Send an email to admins if the service is getting worse, otherwise do nothing.ifinstance.status>instance._status:mail_admins("Alert","Service{}is{}".format(instance.name,instance.get_status_display()))REST APIdjango-statusboardcomes with a set of REST API to manage its models, based onDjango REST FrameworkModelViewSet:/api/v0.1/servicegroup//api/v0.1/service//api/v0.1/incident//api/v0.1/incidentupdate//api/v0.1/maintenance/DevelopmentRunning tests$ DJANGO_SETTINGS_MODULE=tests.test_settings python manage.py testUpdate i18n$ cd statusboard && django-admin makemessages -l LOCALEContact and copyright informationCopyright (C) 2019-2023 Emanuele Di Giacomoemanuele@digiacomo.ccdjango-statusboard is licensed under GPLv2+.