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
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 %}