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.
This commit is contained in:
malik 2018-02-19 21:53:20 +06:00
parent 1452fe6ecd
commit b9859340b8

View File

@ -61,8 +61,8 @@ import socket
import os
# tricks to have debug toolbar when developing with docker
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 %}
DEBUG_TOOLBAR_CONFIG = {
'DISABLE_PANELS': [