Example #1
0
def initialize_app():
    configurables.verify(REQUIRED_OPTIONS)

    db_store = db.prepare_storage(configurables.database_connector(), 1200)
    ensure_data(db_store())

    session_manager = db.SessionManager(db_store)
    app = api.create_api([session_manager])

    # Add a different root error handler based on: are we in production or not
    error_handler = configurables.root_error_handler()
    app.add_error_handler(Exception, error_handler)

    return app
Example #2
0
from basil_common import configurables

import storage
from . import REQUIRED_OPTIONS

configurables.verify(REQUIRED_OPTIONS)
storage.migrate_db(configurables.database_connector())