from flask import Flask

from config import app_config


def create_app(config_name):
    app = Flask(__name__)

    app.config.from_object(app_config[config_name])
    if not app.config.get("SQLALCHEMY_DATABASE_URI"):
        raise Exception("Environment variable SQLALCHEMY_DATABASE_URI must be defined")

    from flask_restful import Api
    api = Api(app)
    setattr(app, 'api', api)

    with app.app_context():
        api.init_app(app)
        from . import sqlalquemy_store
        from . import routes
        from . import healthcheck_routes

        return app

0fa8ed92442d492623e76db1d515d38d5b311d26
<mask token>

<mask token>


def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(app_config[config_name])
    if not app.config.get('SQLALCHEMY_DATABASE_URI'):
        raise Exception(
            'Environment variable SQLALCHEMY_DATABASE_URI must be defined')
    from flask_restful import Api
    api = Api(app)
    setattr(app, 'api', api)
    with app.app_context():
        api.init_app(app)
        from . import sqlalquemy_store
        from . import routes
        from . import healthcheck_routes
        return app

from flask import Flask
from config import app_config


def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(app_config[config_name])
    if not app.config.get('SQLALCHEMY_DATABASE_URI'):
        raise Exception(
            'Environment variable SQLALCHEMY_DATABASE_URI must be defined')
    from flask_restful import Api
    api = Api(app)
    setattr(app, 'api', api)
    with app.app_context():
        api.init_app(app)
        from . import sqlalquemy_store
        from . import routes
        from . import healthcheck_routes
        return app

from flask import Flask

from config import app_config


def create_app(config_name):
    app = Flask(__name__)

    app.config.from_object(app_config[config_name])
    if not app.config.get("SQLALCHEMY_DATABASE_URI"):
        raise Exception("Environment variable SQLALCHEMY_DATABASE_URI must be defined")

    from flask_restful import Api
    api = Api(app)
    setattr(app, 'api', api)

    with app.app_context():
        api.init_app(app)
        from . import sqlalquemy_store
        from . import routes
        from . import healthcheck_routes

        return app
