Replace os.environ.get with env call in local.py

This commit is contained in:
Nikita P. Shupeyko 2018-05-09 13:15:35 +03:00
parent 17739ff263
commit df1ce737d5

View File

@ -62,9 +62,8 @@ DEBUG_TOOLBAR_CONFIG = {
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
INTERNAL_IPS = ['127.0.0.1', '10.0.2.2'] INTERNAL_IPS = ['127.0.0.1', '10.0.2.2']
{% if cookiecutter.use_docker == 'y' -%} {% if cookiecutter.use_docker == 'y' -%}
import socket if env('USE_DOCKER') == 'yes':
import os import socket
if os.environ.get('USE_DOCKER') == 'yes':
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [ip[:-1] + '1' for ip in ips] INTERNAL_IPS += [ip[:-1] + '1' for ip in ips]
{%- endif %} {%- endif %}