skillfed

django-ebhealthcheck

Django app to add an instance's public IP to ALLOWED_HOSTS for Elastic Beanstalk's health check system

django-ebhealthcheck v2.0.2 80.2K downloads/30d#14,309 on PyPI35
Permissive license BSD DORMANT released

What it is and what it does

django-ebhealthcheck is a Django application that solves a specific problem with AWS Elastic Beanstalk's health check system. When Elastic Beanstalk performs health checks on load-balanced instances, it uses the instance's public IP as the request's host header. By default, Django rejects requests with unrecognized host headers and returns a 400 Bad Request error, causing health checks to fail. This package intercepts that flow at application startup and dynamically adds the instance's public IP to Django's ALLOWED_HOSTS setting, allowing health checks to succeed.

The package depends only on requests and installs as a simple Django app configuration. Version 2.0.0 and later support IMDSv2 (the newer AWS metadata service); earlier versions support IMDSv1. It is marked Production/Stable but has been dormant since mid-2022, suggesting the problem it solves is stable and rarely needs changes.

Use it for:

  • Running a Django application on AWS Elastic Beanstalk without manually managing ALLOWED_HOSTS for each instance's public IP.
  • Preventing health check failures caused by Django rejecting requests with unrecognized host headers in load-balanced environments.
  • Automating host validation on Elastic Beanstalk deployments to reduce configuration overhead and deployment errors.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically adds an Elastic Beanstalk instance's public IP to Django's ALLOWED_HOSTS during application startup, allowing health checks to succeed without 400 Bad Request errors.

Yes, if you are running Django on AWS Elastic Beanstalk and experiencing health check failures due to ALLOWED_HOSTS validation. It solves a narrow, well-defined problem with minimal dependencies and no security vulnerabilities. The dormant maintenance status is not a concern for a stable, single-purpose utility. Install it if this is your deployment model; skip it otherwise.

Install

django-ebhealthcheck on PyPI

pip

pip install django-ebhealthcheck

uv

uv add django-ebhealthcheck

poetry

poetry add django-ebhealthcheck

Installing django-ebhealthcheck

Before you install

Installation is straightforward with low friction—a single wheel dependency on requests. The package is dormant (last release August 2022, last commit October 2023) but marked Production/Stable; it solves a narrow, stable problem unlikely to require frequent updates.

License in practice

BSD permissive license imposes no significant restrictions; you may use, modify, and distribute the package freely in commercial and private projects.

Quickstart

pip install django-ebhealthcheck

# In settings.py INSTALLED_APPS:
INSTALLED_APPS = [
    ...
    'ebhealthcheck.apps.EBHealthCheckConfig',
    ...
]

Requires Django to be installed and configured; IMDSv2 support requires version 2.0.0 or higher (use version 1.x for IMDSv1-only environments).

Verify before relying

  • Whether the package works with current Django versions (latest release was August 2022).
  • Compatibility with Python versions beyond what the fact sheet specifies.

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests
Maintenance dormant — 1,453 days since the last release
Last repo commit
First released
Downloads 80,208/month — #14,309 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_ebhealthcheck-2.0.2-py2.py3-none-any.whl

Development Status :: 5 - Production/StableFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Software Development :: Libraries :: Python Modules

Tags

django elastic beanstalk health checkallowed hosts elastic beanstalkdjango eb health checkbeanstalk public ip djangoelastic beanstalk 400 bad requestdjango imdsv2 health check
aws-elastic-beanstalkdjango-middleware

More Python Modules packages