Skip to content

Commit 46ca676

Browse files
committed
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
1 parent 5132661 commit 46ca676

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

docker/configs/settings_local.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@
5555
SUBMIT_YANG_INVAL_MODEL_DIR = 'data/developers/ietf-ftp/yang/invalmod/'
5656
SUBMIT_YANG_IANA_MODEL_DIR = 'data/developers/ietf-ftp/yang/ianamod/'
5757
SUBMIT_YANG_RFC_MODEL_DIR = 'data/developers/ietf-ftp/yang/rfcmod/'
58+
59+
# Set INTERNAL_IPS for use within Docker. See https://knasmueller.net/fix-djangos-debug-toolbar-not-showing-inside-docker
60+
import socket
61+
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
62+
INTERNAL_IPS = [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]

0 commit comments

Comments
 (0)