Skip to content

Add show_toolbar_with_docker function for Docker IP handling #2123

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
wants to merge 1 commit into from

Conversation

blingblin-g
Copy link
Member

Description

  • Introduced a new function, show_toolbar_with_docker, to determine if the toolbar should be displayed when running inside Docker containers.
  • Updated installation documentation to reference the new function for Docker configurations.
  • Added a changelog entry for the new functionality.

Fixes #2113

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

- Introduced a new function, show_toolbar_with_docker, to determine if the toolbar should be displayed when running inside Docker containers.
- Updated installation documentation to reference the new function for Docker configurations.
- Added a changelog entry for the new functionality.
@blingblin-g blingblin-g self-assigned this Apr 9, 2025
Copy link
Member

@matthiask matthiask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I'd already comment on the draft. Thanks for taking this on!

* Add hook to RedirectsPanel for subclass customization
* Added ``show_toolbar_with_docker`` function to check Docker host IP address
when running inside Docker containers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first entry seems to be a duplicate of something old?

The second entry is good, but it should go up into the "Pending" section.

@@ -155,7 +155,7 @@ option.
If using Docker, the toolbar will attempt to look up your host name
automatically and treat it as an allowable internal IP. If you're not
able to get the toolbar to work with your docker installation, review
the code in ``debug_toolbar.middleware.show_toolbar``.
the code in ``debug_toolbar.middleware.show_toolbar_with_docker``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, that warning has to be reworked. Something like:

"If using Docker you can use debug_toolbar.middleware.show_toolbar_with_docker which attempts to automatically look up the Docker gateway IP and treat it as an allowable internal IP so that the toolbar is shown to you."

@matthiask
Copy link
Member

Hi @blingblin-g
I wanted to ask if you still intend to work on this and/or if there's anything I can do to help get this moving?

@matthiask
Copy link
Member

Replaced by #2153

@matthiask matthiask closed this Jul 8, 2025
@blingblin-g
Copy link
Member Author

@matthiask

Oh, Sorry. I just noticed that the PR I was responsible for was closed just now after remaining unfinished for a long time. Could you please let me know if there is anything else that needs to be done regarding this task?

And I will make sure to share updates on my progress more frequently and inform you in advance if there are any delays.

Thank you.

@matthiask
Copy link
Member

Hi @blingblin-g

Sure, I'd appreciate a review on the new PR over here: #2153

I mostly only applied the suggested changes and submitted it myself again, still with you as the author.

@blingblin-g
Copy link
Member Author

Great! I’d love to review it.

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

Successfully merging this pull request may close these issues.

host.docker.internal DNS lookup causes 15s delay in offline environments
2 participants