-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Show toolbar for docker's internal IP address #1887
Show toolbar for docker's internal IP address #1887
Conversation
@epicserve could you give this a test run for me? |
04c0caa
to
04cd100
Compare
I tested it out and it worked. You can see my code here. |
Excellent thank you. @matthiask I know this is a hack, but I personally don't see a difference between asking a developer to copy/paste the hack themselves versus us writing it in for them and letting them know where it exists. At least for a development tool like this. I do wonder if we could setup a test that's better than a mock though. @epicserve do you have any ideas on how that could be done? I haven't researched it at all, so I apologize if it's just a search away. |
If you're developing with a Django server in a Docker container with docker, the instructions for enabling the toolbar don't work. The reason is related to the fact that the actual address that you would need to add to INTERNAL_IPS is going to be something dynamic, like 172.24.0.1. Rather than trying to dynamically set the value of INTERNAL_IPS, the straightforward solution is to replace the function that enables the toolbar, in your settings.py, for example: DEBUG_TOOLBAR_CONFIG = { This should also work for other dynamic routing situations, like Vagrant or Heroku. follow the link: https://stackoverflow.com/questions/10517765/django-debug-toolbar-not-showing-up |
@tim-schilling, mocking is how I would handle testing it. I can't think of a better alternative. |
Yes, I did and it work.
Best Regards,
Nitai Roy
… On 20 Feb, 2024, at 5:13 PM, Tim Schilling ***@***.***> wrote:
@nitairoy <https://github.com/nitairoy> did you attempt to use the code in this PR? Also, please see the discussion in #1854 <#1854>.
—
Reply to this email directly, view it on GitHub <#1887 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAXZKDP2TCXOL5JZGI7XJETYUSAOZAVCNFSM6AAAAABDNPQ6RGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJTHE4DQMBQHA>.
You are receiving this because you were mentioned.
|
Yes, I agree. It would certainly be nice if the toolbar worked out of the box for everyone. |
For historical purposes, this caused a regression
Fix in |
Description
This attempts to automatically look up the docker internal IP address for the developer.
Fixes #1854
Checklist:
docs/changes.rst
.