From df1ce737d5d8744241e6d1d804a3e3b7b9379d76 Mon Sep 17 00:00:00 2001 From: "Nikita P. Shupeyko" Date: Wed, 9 May 2018 13:15:35 +0300 Subject: [PATCH] Replace os.environ.get with env call in local.py --- {{cookiecutter.project_slug}}/config/settings/local.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 62dff5521..d4f5a27a8 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -62,9 +62,8 @@ DEBUG_TOOLBAR_CONFIG = { # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips INTERNAL_IPS = ['127.0.0.1', '10.0.2.2'] {% if cookiecutter.use_docker == 'y' -%} -import socket -import os -if os.environ.get('USE_DOCKER') == 'yes': +if env('USE_DOCKER') == 'yes': + import socket hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS += [ip[:-1] + '1' for ip in ips] {%- endif %}