123456789101112 |
- import configparser
- import os
- config = configparser.ConfigParser()
- if os.environ.get('APP_ENV', 'development') == 'development':
- config.readfp(open('development.ini'))
- elif os.environ.get('APP_ENV') == 'production':
- config.readfp(open('production.ini'))
- print(config.get('DATABASE', 'host'))
|