Fix INTERNAL_IPS for DOCKER when ip higher than 9

previously, for IP ex: 172.19.0.13 becomes: 172.19.0.11
now, it becomes 172.19.0.1
This commit is contained in:
Duda Nogueira 2020-04-07 18:53:09 -03:00 committed by GitHub
parent 3d4f530eca
commit 1d2d881aba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,7 @@ if env("USE_DOCKER") == "yes":
import socket
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + "1" for ip in ips]
INTERNAL_IPS += [".".join(ip.split(".")[:-1]+["1"]) for ip in ips]
{%- endif %}
# django-extensions