Skip to content

Instantly share code, notes, and snippets.

@bulv1ne
Last active December 22, 2015 15:59
Show Gist options
  • Save bulv1ne/6496562 to your computer and use it in GitHub Desktop.
Save bulv1ne/6496562 to your computer and use it in GitHub Desktop.
# self.app can be None
# self.app.config.get('DATABASE') can be None
try:
db = self.app.config['DATABASE']
logger.debug('Using database "{db}"'.format(db=db))
except:
db = 'test'
logger.warning('DATABASE setting not set, using database "test"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment