mirror of
				https://gitlab.crans.org/mediatek/med.git
				synced 2025-11-03 20:52:05 +01:00 
			
		
		
		
	postgresql by default
This commit is contained in:
		
							
								
								
									
										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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user