Example #1
0
	def db_session(self):
		if self._db_session is None:
			if self.testing:
				self._db_session = get_session_from_uri(DATABASE_TESTING_CONFIG.URI)
			else:
				self._db_session = get_session_from_uri(DATABASE_CONFIG.URI)
		return self._db_session
Example #2
0
 def before_request():
     g.db = get_session_from_uri(database_config.URI)
     initialize_base(g.db)