Registry / devops / django-ebhealthcheck

django-ebhealthcheck

JSON →
library2.0.2pypypiunverified

Django app that automatically adds the instance's public IP to ALLOWED_HOSTS for AWS Elastic Beanstalk health checks. Version 2.0.2 is current; release cadence is low (last release 2020).

pip install django-ebhealthcheck
INSTALL
IMPORT
SIG · DJANGO-EBHEALTHCHE
D
django-ebhealthcheck
devopspythonv2.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EBHealthCheckMiddleware
from ebhealthcheck import EBHealthCheckMiddleware
from ebhealthcheck.middleware import EBHealthCheckMiddleware

Add to INSTALLED_APPS and MIDDLEWARE, then run management command periodically.

# settings.py INSTALLED_APPS = [ ... 'ebhealthcheck', ] MIDDLEWARE = [ ... 'ebhealthcheck.middleware.EBHealthCheckMiddleware', ] # Optional: customize health check path (default '/healthcheck/') EB_HEALTHCHECK_PATH = '/health/' # Run management command to update ALLOWED_HOSTS (cron or startup) # python manage.py update_eb_allowed_hosts
Debug
Known issues
breakingALLOWED_HOSTS is updated persistently via the management command, not just in memory. If the instance IP changes, old entries persist.
fix
Run 'python manage.py update_eb_allowed_hosts' on a schedule (e.g., cron) to refresh IPs.
affects: all
deprecatedThe library is in maintenance mode; no updates since 2020. May not work with recent Django versions (e.g., 4.x/5.x) due to middleware API changes.
fix
Test with your Django version. Consider alternative like django-allow-cidr or manual ALLOWED_HOSTS configuration.
affects: 2.0.0-2.0.2
gotchaThe middleware only adds the instance's public IP. If multiple instances or IP changes, you must run the management command. Health check path defaults to '/healthcheck/'.
fix
Set EB_HEALTHCHECK_PATH in settings if your health check endpoint differs.
affects: all
Upgrade
Version history
2.0.2latest on PyPI · released Aug 22, 2022
Audit
Dependencies
DjangorequiredRequired for ALLOWED_HOSTS integration and health check endpoint.
boto3requiredUsed to fetch EC2 instance metadata (IP).
Agent activity
15 hits · last 30 days
node
14
Resources