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 = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': '5432',
'ATOMIC_REQUESTS': True
}
}
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'postgres',
# 'USER': 'postgres',
# 'HOST': 'db',
# 'PORT': '5432',
# 'ATOMIC_REQUESTS': True
# }
# }
if os.environ.get('ENV') == 'PRODUCTION':
# Heroku
# db_from_env = dj_database_url.config(conn_max_age=500)
# DATABASES['default'].update(db_from_env)
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
# Docker
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': '5432',
'ATOMIC_REQUESTS': True
}
}
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'postgres',
# 'USER': 'postgres',
# 'HOST': 'db',
# 'PORT': '5432',
# 'ATOMIC_REQUESTS': True
# }
# }
AUTH_PASSWORD_VALIDATORS = [