Package: django-status
Version:2.2.1Status:Production/StableAuthor:José Antonio Perdiguero LópezDjango Status is an application that provides an API to check the status of some parts and some utilities like ping
requests. This application can works as standalone or included in a Django project.Quick startInstall this package using pip:pip install django-statusAddPROJECT_PATHto your django settings module.Addstatusto yourINSTALLED_APPSsettings like this:INSTALLED_APPS = (
    ...
    'status',
)AddDjango-statusurls to your project urls:urlpatterns = [
    ...
    url(r'^status/', include('status.urls')),
]Check ProvidersDjango Status provides a mechanism to add new custom check functions throughcheck providers. Each check provider
will generate a new API method with an URL that uses the name of the provider. These functions must accept *args and
**kwargs and will return a JSON-serializable object through json.dumps() method, for example a ping function:def ping(*args, **kwargs):
    return {'pong': True}By defaultDjango statusprovides the follow checks:PingA ping to application.
URL: /api/health/pingDatabasesCheck if databases are running.
URL: /api/health/databasesCachesCheck if caches are running.
URL: /api/health/cachesCeleryCheck if celery workers defined in settings are running.
URL: /api/health/celeryDatabases statsShow stats for all databases.
URL: /api/stats/databasesCelery statsShow celery worker stats.
URL: /api/stats/celeryCodeSource code stats such as current active branch, last commit, if debug is active…
URL: /api/stats/codeDjango Status websiteA website that shows Django Status data is available in this application. It’s possible access to follow URLs to get a
detailed view of your system status. Those three pages will show results of providers configured (as explained in
settings section):http://www.website.com/status/
http://www.website.com/status/health/
http://www.website.com/status/stats/Django Status APIDjango Status API can be used as a standalone application including only their urls:urlpatterns = [
    ...
    url(r'^status/', include('status.api.urls')),
]This API have a single url for each provider, that are grouped by resources.
Each provider can be queried alone, returning his current status:http://your_domain/status/api/health/pingAlso there is a resource view that will return the status of all providers:http://your_domain/status/api/healthFor last, there is a root view that will return the status of all providers from all resources:http://your_domain/status/apiDjango management commandsDjango Status provides a django management command to query current status of a resource. This command can be call as:python manage.py status <resource> [options]To get current status of health checks, and exit with an error if some check is failing:python manage.py status health -eEach resource has its own set of options that can be displayed through command help:python manage.py status -hCommandPrevious Django command can be used in standalone mode as:django_status <resource> [options]SettingsSTATUS_CHECK_PROVIDERSList of additional check providers. Each provider consists in a tuple of name, function complete path, args and kwargs.
Example:STATUS_PROVIDERS = {
    'resource': (
        ('test', 'application.module.test_function', [1, 2], {'foo': 'bar'}),
    )
}Default:PROVIDERS = getattr(settings, 'STATUS_PROVIDERS', {
    'health': (
        ('ping', 'status.providers.health.ping', None, None),
        ('databases', 'status.providers.django.health.databases', None, None),
        ('caches', 'status.providers.django.health.caches', None, None),
    ),
    'stats': (
        ('databases', 'status.providers.django.stats.databases', None, None),
        ('code', 'status.providers.stats.code', None, None),
    )
}STATUS_CELERY_WORKERSList of hostname from celery workers to be checked. If any worker is defined, two additional providers listed previously
will be added to default set.
Default:STATUS_CELERY_WORKERS = ()