Created
March 8, 2017 16:02
-
-
Save mingrammer/fe4440b750184ff658790ce0cb4d474c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main_with_ini.py | |
import configparser | |
config = configparser.ConfigParser() | |
config.read('config.ini') | |
secret_key = config['DEFAULT']['SECRET_KEY'] # 'secret-key-of-myapp' | |
ci_hook_url = config['CI']['HOOK_URL'] # 'web-hooking-url-from-ci-service' | |
# main_with_json.py | |
import json | |
with open('config.json', 'r') as f: | |
config = json.load(f) | |
secret_key = config['DEFAULT']['SECRET_KEY'] # 'secret-key-of-myapp' | |
ci_hook_url = config['CI']['HOOK_URL'] # 'web-hooking-url-from-ci-service' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment