Skip to main content

Django Views Plugin for Simple Health Checks

Provides 2 views that can be added to a django projects urls

Simply add the following to your urls file in your django project:

from simple_health_checks.urls import HEALTH_CHECK, PING

urlpatterns = [
    ...
    HEALTH_CHECK,
    PING,
]

Alternatively you can use the following but the middleware skip will not be active unless your ping url matches HEALTH_CHECKS_PING_PATH:

from simple_health_checks.views.views import HealthCheck, ping

urlpatterns = [
    ...
    url(r'^health/', HealthCheck.as_view(), name="health"),
    url(r'^ping/', ping, name="ping"),
]

To ensure that we skip middleware you MUST add "simple_health_checks.middleware.SkipMiddlewarePing" to the top of MIDDLEWARE in your django settings file.

Required environment variables

HEALTH_CHECKS_CRITICAL_ON_PING - used for resources that may hang when down but prevent the service from functioning. This can be used to force a proxy that monitors this endpoint to display a service down error and prevent future requests until it recovers. Comma separated resource names, matching the filename that defines the resource.

HEALTH_CHECKS_TOKEN - token used to gain access to more detailed information from the health endpoint

HEALTH_CHECKS_PING_PATH (Optional) - can be used to define a the ping uri if you wish to use from simple_health_checks.urls import HEALTH_CHECK, PING with a custom path

HEALTH_CHECKS_HEALTH_PATH (Optional) - can be used to define the health uri if you wish to use from simple_health_checks.urls import HEALTH_CHECK, PING with a custom path

PING_PATH is also used to ensure that when the ping endpoint is used we skip any django middleware that may try to communicate with a resource that may hang and cause an issue for the ping endpoint responding.

Metadata

Release files for simple-health-checks-django-views 1.0.2

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

Source distribution (sdist)

Source distribution for simple-health-checks-django-views 1.0.2
File Size Uploaded Provenance
simple_health_checks_django_views-1.0.2.tar.gz 4.4 kB Without provenance Details

Release files / simple_health_checks_django_views-1.0.2.tar.gz

Download URL simple_health_checks_django_views-1.0.2.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e1891c32b5946d4a13d6f94975573f54f040ae949a265fd6a459ee8d2b3fbfac
BLAKE2b-256 checksum
How to use checksums
43cbce369831b45a8a7c0d202c0268e74f8a1509fc4a8361ada578bea99d9c6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

Security for simple-health-checks-django-views 1.0.2

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

1.0.2 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