Skip to content

Simplify Docker IP determination in middleware.py #2098

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

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 5, 2025
commit f98419e8c30d3795f2e234f44a09473c076dda84
2 changes: 1 addition & 1 deletion debug_toolbar/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def show_toolbar(request):
# This is a hack for docker installations. It attempts to look
# up the IP address of the docker host.
# This is not guaranteed to work.
docker_ip = docker_ip = socket.gethostbyname('gateway.docker.internal')
docker_ip = docker_ip = socket.gethostbyname("gateway.docker.internal")
if request.META.get("REMOTE_ADDR") == docker_ip:
return True
except socket.gaierror:
Expand Down
Loading