django-ebhealthcheck
Django app to add an instance's public IP to ALLOWED_HOSTS for Elastic Beanstalk's health check system
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-ebhealthcheckuv
uv add django-ebhealthcheckpoetry
poetry add django-ebhealthcheckInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
awsebcliEB CLI is a command-line tool for deploying,…
permissive · top 15,000 on PyPI
django-allow-cidrA Django middleware that extends ALLOWED_HOSTS…
permissive · top 5,000 on PyPI
django-watchmandjango-watchman exposes a status endpoint that…
permissive · top 15,000 on PyPI
django-xffDjango middleware that extracts the real client…
permissive · top 15,000 on PyPI
py-healthcheckProvides healthcheck and environment-dump…
permissive · top 15,000 on PyPI
django-defenderBlocks brute-force login attempts in Django by…
permissive · top 15,000 on PyPI
django-ipwareRetrieves the client's IP address from a Django…
permissive · top 5,000 on PyPI
django-health-checkProvides pluggable health check endpoints for…
permissive · top 5,000 on PyPI
fastapi-healthchecksAdds configurable health check endpoints to…
permissive · top 15,000 on PyPI
aws-cdk.aws-elasticloadbalancingProvides AWS CDK constructs for configuring and…
permissive · top 15,000 on PyPI