From 9969f8fa0da67de61f7583d319bf8a741a3e281f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 28 Jan 2021 09:19:14 +0000 Subject: [PATCH] Handle error if node hasn't started yet --- {{cookiecutter.project_slug}}/config/settings/local.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index c69042d5..3ce150e1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -70,8 +70,12 @@ if env("USE_DOCKER") == "yes": hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] {%- if cookiecutter.js_task_runner == 'Gulp' %} - _, _, ips = socket.gethostbyname_ex("node") - INTERNAL_IPS.extend(ips) + try: + _, _, ips = socket.gethostbyname_ex("node") + INTERNAL_IPS.extend(ips) + except socket.gaierror: + # The node container isn't started (yet?) + pass {%- endif %} {%- endif %}