postgresql by default
This commit is contained in:
parent
cf0ced6021
commit
978dc1de6c
14
README.md
14
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
|
||||
|
||||
```
|
||||
|
|
|
@ -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': '',
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,4 +8,5 @@ django-reversion==3.0.3
|
|||
python-stdnum==1.10
|
||||
djangorestframework==3.9.2
|
||||
pyyaml==3.13
|
||||
coreapi==2.3.3
|
||||
coreapi==2.3.3
|
||||
psycopg2
|
||||
|
|
Loading…
Reference in New Issue