import os, yaml config_file = os.path.join(os.path.abspath(ps.path.dirname(__file__)), 'application.yml') conf = yaml.safe_load(open(config_file))['datasource']['local'] application.yml datasource: local: dbType: 'mysql' host: '127.0.0.1' port: '3306' user: 'root' password: '123456' database: '디비이름>_