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

Show debug toolbar when running docker compose #6488

Merged
merged 1 commit into from
Jan 22, 2020
Merged

Conversation

humitos
Copy link
Member

@humitos humitos commented Dec 23, 2019

We can't depend on DEBUG + INTERNAL_IPS (default check) because the IP of the docker container is dynamic.

@davidfischer
Copy link
Contributor

This is definitely an option. Another option I've seen in Django Cookiecutter for example is to dynamically add the docker IP to INTERNAL_IPS:

import socket

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

@humitos
Copy link
Member Author

humitos commented Jan 13, 2020

Either way works for me. Since this setting it's only on docker compose file, I'm not too worry about exposing things.

On the other hand, the IP from the container is it the IP from where I'm accessing from the host? 😄

@humitos
Copy link
Member Author

humitos commented Jan 22, 2020

Merging this. Only affect development and both suggested solutions are good. I see the return True just easier to read.

@humitos humitos merged commit ca6506e into master Jan 22, 2020
@humitos humitos deleted the humitos/debug-toolbar branch January 22, 2020 12:06
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.

2 participants