From 46ca67673699e173b88720599d8ac70b44a85446 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Thu, 6 Jan 2022 11:20:49 +0000 Subject: [PATCH] When using Docker, the runserver isn't being accessed over loopback, so we need to initialize INTERNAL_IPS based on the current interface configuration. Commit ready for merge. - Legacy-Id: 19811 --- docker/configs/settings_local.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/configs/settings_local.py b/docker/configs/settings_local.py index 1bb9b7d80..2f6207c90 100644 --- a/docker/configs/settings_local.py +++ b/docker/configs/settings_local.py @@ -55,3 +55,8 @@ SUBMIT_YANG_DRAFT_MODEL_DIR = 'data/developers/ietf-ftp/yang/draftmod/' SUBMIT_YANG_INVAL_MODEL_DIR = 'data/developers/ietf-ftp/yang/invalmod/' SUBMIT_YANG_IANA_MODEL_DIR = 'data/developers/ietf-ftp/yang/ianamod/' SUBMIT_YANG_RFC_MODEL_DIR = 'data/developers/ietf-ftp/yang/rfcmod/' + +# Set INTERNAL_IPS for use within Docker. See https://knasmueller.net/fix-djangos-debug-toolbar-not-showing-inside-docker +import socket +hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) +INTERNAL_IPS = [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] \ No newline at end of file