add env var check before updating INTERNAL_IPS

This commit is contained in:
Julien Almarcha 2016-06-12 20:31:18 +02:00
parent 0bc9797d0f
commit d5dbf38acb
2 changed files with 5 additions and 2 deletions

View File

@ -10,6 +10,7 @@ Local settings
from .common import * # noqa from .common import * # noqa
import socket import socket
import os
# DEBUG # DEBUG
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -50,8 +51,9 @@ INSTALLED_APPS += ('debug_toolbar', )
INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ] INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]
# tricks to have debug toolbar when developing with docker # tricks to have debug toolbar when developing with docker
ip = socket.gethostbyname(socket.gethostname()) if os.environ.get('USE_DOCKER') == 'yes' :
INTERNAL_IPS += [ip[:-1]+"1"] ip = socket.gethostbyname(socket.gethostname())
INTERNAL_IPS += [ip[:-1]+"1"]
DEBUG_TOOLBAR_CONFIG = { DEBUG_TOOLBAR_CONFIG = {
'DISABLE_PANELS': [ 'DISABLE_PANELS': [

View File

@ -22,6 +22,7 @@ services:
- postgres - postgres
environment: environment:
- POSTGRES_USER={{cookiecutter.project_slug}} - POSTGRES_USER={{cookiecutter.project_slug}}
- USE_DOCKER=yes
volumes: volumes:
- .:/app - .:/app
ports: ports: