Skip to main content

Installation

pip install dj-healthchecks

Usage

Add to a project

In urls.py:

from django.conf.urls import url, include

from rest_framework import routers
from healthchecks.api import HealthViewSet

router = routers.DefaultRouter()
router.register(r'health', HealthViewSet, basename='health')

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^', include(router.urls)),
]

You define your healthchecks in settings.py

HEALTH_CHECKS = [
    'healthchecks.checks.im_ok',
    'healthchecks.checks.connect_to_db',
    'healthchecks.checks.connect_to_queue',
    'healthchecks.checks.connect_to_redis',
    'healthchecks.checks.ping_upstream_urls',
    ...
]

This library provides some utility healthchecks, but you can also easily write your own.

Provided healthchecks are in healthchecks/checks.py

Specifying your own healthcheck:

HEALTH_CHECKS = [
    ...
    'myapp.myodule.my_health_check',
]

Now you have:

GET /health/ # run all health checks in settings.py
GET /health/some-health-check/ # run a specific healthcheck

Note: for a specific healthcheck, you - will be replaced with .

Run project:

docker-compose up

Run tests:

docker-compose run --rm web python manage.py test

Profit.

Updating

Bump the version:

bumpversion manjor|minor|patch

Push to master

Metadata

Release files for dj-healthchecks 0.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 dj-healthchecks 0.0.1
File Size Uploaded Provenance
dj-healthchecks-0.0.1.tar.gz 3.0 kB Without provenance Details

Release files / dj-healthchecks-0.0.1.tar.gz

Download URL dj-healthchecks-0.0.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b44e8ec2d21ca8007b0fccd814b5a07b4199ab3d314a376d23d45eddda195c61
BLAKE2b-256 checksum
How to use checksums
01fdee3b46956e9b42e1dbfbb979479597892faf0717befee2d46f4dfe6b5036
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Security for dj-healthchecks 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

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