Skip to content

Commit

Permalink
Add IPs for Docker to enable Debug toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
anorthall committed Apr 28, 2024
1 parent 178ddf1 commit 57709d1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion reportdb/reportdb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"debug_toolbar.middleware.DebugToolbarMiddleware",
]

# noinspection PyUnresolvedReferences
ROOT_URLCONF = "reportdb.urls"

TEMPLATES = [
Expand Down Expand Up @@ -199,4 +200,13 @@


# Add Docker host IP to ALLOWED_HOSTS for Dokku healthchecks
ALLOWED_HOSTS.append(socket.getaddrinfo(socket.gethostname(), "http")[0][4][0])
ALLOWED_HOSTS.append(socket.getaddrinfo(socket.gethostname(), "http")[0][4][0]) # type: ignore[attr-defined]


# Find local IPs for debug toolbar
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[: ip.rfind(".")] + ".1" for ip in ips] + [
"127.0.0.1",
"10.0.2.2",
"192.168.65.1",
]

0 comments on commit 57709d1

Please sign in to comment.