Skip to content

Commit 6c8538a

Browse files
flyudvikwebyneter
authored andcommitted
Add all internal IPs for multiple docker networks (cookiecutter#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
1 parent 0bd019d commit 6c8538a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CONTRIBUTORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Listed in alphabetical order.
116116
Luis Nell `@originell`_
117117
Lukas Klein
118118
Lyla Fischer
119+
Malik Sulaimanov `@flyudvik`_ @flyudvik
119120
Martin Blech
120121
Mathijs Hoogland `@MathijsHoogland`_
121122
Matt Braymer-Hayes `@mattayes`_ @mattayes
@@ -196,6 +197,7 @@ Listed in alphabetical order.
196197
.. _@eraldo: https://github.com/eraldo
197198
.. _@eriol: https://github.com/eriol
198199
.. _@eyadsibai: https://github.com/eyadsibai
200+
.. _@flyudvik: https://github.com/flyudvik
199201
.. _@garry-cairns: https://github.com/garry-cairns
200202
.. _@garrypolley: https://github.com/garrypolley
201203
.. _@goldhand: https://github.com/goldhand

{{cookiecutter.project_slug}}/config/settings/local.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
import socket
6565
import os
6666
if os.environ.get('USE_DOCKER') == 'yes':
67-
ip = socket.gethostbyname(socket.gethostname())
68-
INTERNAL_IPS += [ip[:-1] + '1']
67+
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
68+
INTERNAL_IPS += [ip[:-1] + '1' for ip in ips]
6969
{%- endif %}
7070

7171
# django-extensions

0 commit comments

Comments
 (0)