diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 7d538b8fd..3d429afb9 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -73,8 +73,11 @@ INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"] if env("USE_DOCKER") == "yes": import socket - hostname, _, ips = socket.gethostbyname_ex("host.docker.internal") - INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] + try: + hostname, _, ips = socket.gethostbyname_ex("host.docker.internal") + INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] + except socket.gaierror: + pass {%- if cookiecutter.frontend_pipeline in ['Gulp', 'Webpack'] %} try: _, _, ips = socket.gethostbyname_ex("node")