postgresql by default

This commit is contained in:
Yohann D'anello 2020-02-02 23:55:35 +01:00
parent cf0ced6021
commit 978dc1de6c
3 changed files with 20 additions and 10 deletions

View File

@ -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
```

View File

@ -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': '',
}
}

View File

@ -9,3 +9,4 @@ python-stdnum==1.10
djangorestframework==3.9.2
pyyaml==3.13
coreapi==2.3.3
psycopg2