diff --git a/README.md b/README.md index 37e3086..c398e50 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,20 @@ ainsi qu'un user med et un mot de passe associé. Voici les étapes à éxecuter pour mysql : ```SQL -CREATE DATABASE club-med; -CREATE USER 'club-med'@'localhost' IDENTIFIED BY 'password'; -GRANT ALL PRIVILEGES ON club-med.* TO 'club-med'@'localhost'; +CREATE DATABASE med; +CREATE USER 'med'@'localhost' IDENTIFIED BY 'password'; +GRANT ALL PRIVILEGES ON med.* TO 'med'@'localhost'; FLUSH PRIVILEGES; ``` +Et pour postgresql : + +```SQL +CREATE DATABASE med; +CREATE USER med WITH PASSWORD 'password'; +GRANT ALL PRIVILEGES ON DATABASE med TO med; +``` + ## Exemple de groupes de droits ``` diff --git a/med/settings_local.example.py b/med/settings_local.example.py index 8b2e503..0270880 100644 --- a/med/settings_local.example.py +++ b/med/settings_local.example.py @@ -2,8 +2,6 @@ # Copyright (C) 2017-2019 by BDE ENS Paris-Saclay # SPDX-License-Identifier: GPL-3.0-or-later -import os - # Needed to filter which host are trusted ALLOWED_HOSTS = ['med.crans.org'] @@ -32,11 +30,14 @@ SECRET_KEY = 'CHANGE ME !!!' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'med', + 'USER': 'med', + 'PASSWORD': 'password_to_store_in_env', + 'HOST': 'db', + 'PORT': '', } } + diff --git a/requirements.txt b/requirements.txt index c30b5b1..651bd3a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,5 @@ django-reversion==3.0.3 python-stdnum==1.10 djangorestframework==3.9.2 pyyaml==3.13 -coreapi==2.3.3 \ No newline at end of file +coreapi==2.3.3 +psycopg2