Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug toolbar doesn't show if using a docker webserver container #2020

Open
Eraldo opened this issue Oct 25, 2024 · 0 comments
Open

Debug toolbar doesn't show if using a docker webserver container #2020

Eraldo opened this issue Oct 25, 2024 · 0 comments

Comments

@Eraldo
Copy link

Eraldo commented Oct 25, 2024

I tried the solution approach to auto detect the correct IP and add it to the INTERNAL_IPS:

INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
if env("USE_DOCKER") == "yes":
    import socket

    hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
    INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]

This correctly detects my "django" container ip (172.18.0.5) and adds it to the INTERNAL_IPS.

However I am using a caddy webserver (172.18.0.6) and so the debug toolbar does not show in the end.
If I manually add 172.18.0.6 to the INTERNAL_IPS, it works as expected. (just to confirm)

Any ideas? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant