gethostname to fix ALB limitation with ALLOWED_HOSTS
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
+from socket import gethostname, gethostbyname
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -25,7 +26,8 @@ SECRET_KEY = 'ny#b__$f6ry4wy8oxre97&-68u_0lk3gw(z=d40_dxey3zw0v1'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
-ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'cccatalog-api-alb-792133319.us-west-1.elb.amazonaws.com']
+ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'cccatalog-api-alb-792133319.us-west-1.elb.amazonaws.com',
+ gethostname(), gethostbyname(gethostname())]
# Application definition
