[conf] fix default config

This commit is contained in:
Maxime Alves LIRMM@home 2020-07-28 09:54:29 +02:00
parent ad3792340c
commit 9e4c3506d5
1 changed files with 7 additions and 5 deletions

View File

@ -4,16 +4,18 @@ from os import environ
import sys import sys
from configparser import ConfigParser from configparser import ConfigParser
config = ConfigParser(defaults={ default_config = {
'project': { 'project': {
'host': '127.0.0.1', 'host': '127.0.0.1',
'port': '8000', 'port': '8000',
'secret': None, 'secret': ''
'base_dir': None, 'base_dir': ''
'production': False 'production': ''
}
} }
})
config = ConfigParser()
config.read_dict(default_config)
config.read(filenames=['.halfapiconfig']) config.read(filenames=['.halfapiconfig'])
PROJECT_NAME = config.get('project', 'name') PROJECT_NAME = config.get('project', 'name')