Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit b753a25

Browse files
committed
fixed allowed hosts error that is causing health checks to fail
1 parent 11be0cc commit b753a25

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

backend/backend/settings/production.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
from .base import * # noqa
2+
import requests
23

3-
ALLOWED_HOSTS = [os.environ.get("FULL_DOMAIN_NAME")] # noqa
4+
ALLOWED_HOSTS = [] # noqa
5+
6+
# https://stackoverflow.com/questions/49828259/when-deploying-django-into-aws-fargate-how-do-you-add-the-local-ip-into-allowed
7+
METADATA_URI = os.environ['ECS_CONTAINER_METADATA_URI'] # noqa
8+
container_metadata = requests.get(METADATA_URI).json()
9+
ALLOWED_HOSTS.append(container_metadata['Networks'][0]['IPv4Addresses'][0])
410

511
# Email
612

0 commit comments

Comments
 (0)