Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Easily create an endpoint for health checks

Project Description

Framework for adding an endpoint for health checks to your project.

Source code


Install the app:


# If specified, this user is able to see the details for each
# individual check in the endpoint.

urlpatterns = [
    url(r'^', include('healthpoint.urls')),

Add a module named to any of your apps. For example:

from datetime import timedelta

from django.contrib.auth.models import User
from django.utils import timezone

from healthpoint.decorators import health_check

def user_signup():
    last_user = User.objects.last()
    time_since_last_signup = - last_user.date_joined
    # Return True/False, throw an exception, or return a tuple with a
    # detail message.
    return (
        time_since_last_signup <= timedelta(days=1),
        "last signup was: {}".format(last_user.date_joined))

The health checks can be accessed via the /health/ endpoint:

  • It executes all health checks, and reports status 200 if all checks succeed, status 500 otherwise.

  • If a staff user is logged in, the endpoint reports the result for each individual check:

     "success": {},
     "error": {
       "": "Last signup was: 2017-10-29 08:45:51"
  • To provide more detail on the result, the @health_check can return a tuple (success:bool, detail:str). The detail message will be listed in the result.

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(5.6 kB) Copy SHA256 Hash SHA256
Source None Mar 4, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers