Add all internal IPs for multiple docker networks (#1520)

* Add all internal IPs for multiple docker networks

When developing with modified docker-compose.yml that contains multiple
network definitions, all networks gateways of the created container
should be added to INTERNAL_IPS, otherwise Django-Debug-Toolbar will not
work.

* Add @flyudvik to contributors
This commit is contained in:
Malik S 2018-03-08 18:54:24 +06:00 committed by Nikita Shupeyko
parent 0bd019deb0
commit 6c8538abfe
2 changed files with 4 additions and 2 deletions

View File

@ -116,6 +116,7 @@ Listed in alphabetical order.
Luis Nell `@originell`_
Lukas Klein
Lyla Fischer
Malik Sulaimanov `@flyudvik`_ @flyudvik
Martin Blech
Mathijs Hoogland `@MathijsHoogland`_
Matt Braymer-Hayes `@mattayes`_ @mattayes
@ -196,6 +197,7 @@ Listed in alphabetical order.
.. _@eraldo: https://github.com/eraldo
.. _@eriol: https://github.com/eriol
.. _@eyadsibai: https://github.com/eyadsibai
.. _@flyudvik: https://github.com/flyudvik
.. _@garry-cairns: https://github.com/garry-cairns
.. _@garrypolley: https://github.com/garrypolley
.. _@goldhand: https://github.com/goldhand

View File

@ -64,8 +64,8 @@ INTERNAL_IPS = ['127.0.0.1', '10.0.2.2']
import socket
import os
if os.environ.get('USE_DOCKER') == 'yes':
ip = socket.gethostbyname(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + '1']
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + '1' for ip in ips]
{%- endif %}
# django-extensions