This commit is contained in:
Ruidy Nemausat 2019-12-04 16:46:05 +01:00
parent 976227bcc4
commit 692f2a8982
2 changed files with 22 additions and 27 deletions

View file

@ -1,5 +0,0 @@
build:
docker:
web: Dockerfile
run:
web: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"

View file

@ -78,32 +78,32 @@ WSGI_APPLICATION = 'villafleurie.wsgi.application'
# } # }
# } # }
DATABASES = { # DATABASES = {
'default': { # 'default': {
'ENGINE': 'django.db.backends.postgresql', # 'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres', # 'NAME': 'postgres',
'USER': 'postgres', # 'USER': 'postgres',
'HOST': 'db', # 'HOST': 'db',
'PORT': '5432', # 'PORT': '5432',
'ATOMIC_REQUESTS': True # 'ATOMIC_REQUESTS': True
} # }
} # }
if os.environ.get('ENV') == 'PRODUCTION': if os.environ.get('ENV') == 'PRODUCTION':
# Heroku # Heroku
# db_from_env = dj_database_url.config(conn_max_age=500) db_from_env = dj_database_url.config(conn_max_age=500)
# DATABASES['default'].update(db_from_env) DATABASES['default'].update(db_from_env)
# Docker # Docker
DATABASES = { # DATABASES = {
'default': { # 'default': {
'ENGINE': 'django.db.backends.postgresql', # 'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres', # 'NAME': 'postgres',
'USER': 'postgres', # 'USER': 'postgres',
'HOST': 'db', # 'HOST': 'db',
'PORT': '5432', # 'PORT': '5432',
'ATOMIC_REQUESTS': True # 'ATOMIC_REQUESTS': True
} # }
} # }
AUTH_PASSWORD_VALIDATORS = [ AUTH_PASSWORD_VALIDATORS = [