高洛峰2017-04-17 17:19:58
I haven’t read that book, so I don’t know the specific code;
Is your config_name ‘heroku’?
Usually KeyError is that the key does not exist in the dict; that is, there is no value for the key ‘heroku’ in your config.
You can use config.get(config_name) to check if it is None.