comment-server/lbry_comment_server/settings.py
2019-05-21 06:56:27 -04:00

20 lines
485 B
Python

import json
import pathlib
import logging
logger = logging.getLogger(__name__)
root_dir = pathlib.Path(__file__).parent.parent
config_path = root_dir / 'config' / 'conf.json'
def get_config(filepath):
with open(filepath, 'r') as cfile:
conf = json.load(cfile)
for key, path in conf['PATH'].items():
conf['PATH'][key] = str(root_dir / path)
return conf
config = get_config(config_path)
logger.info('Loaded conf.json: %s', json.dumps(config, indent=4))