From d43af2278e83ce2b270ce95b8df7c453a27f8ae5 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Fri, 26 Jan 2018 08:24:39 +0100 Subject: [PATCH] =?UTF-8?q?Mode=20production=20utilise=20d=C3=A9sormais=20?= =?UTF-8?q?postgreSQL=20comme=20base=20de=20donn=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection/environments/production.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/collection/collection/environments/production.py b/collection/collection/environments/production.py index 97fa3db..ceb3716 100644 --- a/collection/collection/environments/production.py +++ b/collection/collection/environments/production.py @@ -15,8 +15,20 @@ ALLOWED_HOSTS = [os.getenv('ALLOWED_HOSTS', '*')] # `proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;` USE_X_FORWARDED_HOST = True -# CORS: allow all site to make cross site requests -CORS_ORIGIN_ALLOW_ALL = True - +# CORS: allow all site to make cross site requests +CORS_ORIGIN_ALLOW_ALL = True + # CORS: limit to API only CORS_URLS_REGEX = r'^/api/.*$' + +# WARNING: you need to install psycopg2 with pip +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': os.getenv('POSTGRES_DB', 'postgres'), + 'USER': os.getenv('POSTGRES_USER', 'postgres'), + 'PASSWORD': os.getenv('POSTGRES_PASS', 'postgres'), + 'HOST': os.getenv('POSTGRES_HOST', '127.0.0.1'), + 'PORT': os.getenv('POSTGRES_PORT', '5432'), + } +}