Update development docker setup
This commit is contained in:
@@ -7,19 +7,12 @@ from django.utils.translation import ugettext_lazy as _
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
IS_DOCKER = bool(os.getenv('IS_DOCKER', None))
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
|
||||
|
||||
|
||||
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
|
||||
|
||||
if not IS_DOCKER:
|
||||
ALLOWED_HOSTS = []
|
||||
else:
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
# Logger level
|
||||
|
||||
LOGGERLEVEL = logging.DEBUG
|
||||
@@ -166,36 +159,6 @@ TEMPLATES = [
|
||||
|
||||
WSGI_APPLICATION = 'sikweb.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
|
||||
|
||||
if not IS_DOCKER:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'sik',
|
||||
'USER': 'sik',
|
||||
'PASSWORD': 'password123',
|
||||
'HOST': 'localhost',
|
||||
'PORT': '5432',
|
||||
'TEST': {
|
||||
'NAME': 'sik_test',
|
||||
},
|
||||
},
|
||||
}
|
||||
else:
|
||||
logging.info('Using docker database configuration')
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'postgres',
|
||||
'USER': 'postgres',
|
||||
'PASSWORD': 'postgres',
|
||||
'HOST': 'db',
|
||||
'PORT': '5432',
|
||||
},
|
||||
}
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
|
||||
|
||||
|
||||
Reference in New Issue
Block a user