Ejemplo n.º 1
0
def create_app(config: config):
    app = Flask(__name__)

    from app import routes
    routes.load(app)

    return app
Ejemplo n.º 2
0
def create_app():
    # pega o nome do arquivo que está sendo executado
    app = Flask(__name__)

    routes.load(app)
    # Retorna o próprio app
    return app
Ejemplo n.º 3
0
def create_app(config_name: str):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    db.init_app(app)
    ma.init_app(app)

    from app import routes

    routes.load(app)

    return app
Ejemplo n.º 4
0
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])

    db.init_app(app)
    CORS(app)

    api = Api(app, prefix='/api/v1')

    from app import routes
    routes.load(api)

    return app
Ejemplo n.º 5
0
def create_app(config_name="development"):
    app = Flask(__name__)
    app.config.from_object(config.get(config_name))

    # load extensions
    db.init_app(app)
    CORS(app)
    JWTManager(app)
    api = Api(app)

    from app import routes

    routes.load(api)

    return app
Ejemplo n.º 6
0
def create_app():
    app = Flask(__name__,
                template_folder=os.path.join(basedir, "src", "templates"),
                static_folder=os.path.join(basedir, "src", "static"))
    app.config['SECRET_KEY'] = 'testing'

    from app import routes

    routes.load(app)

    from app.filters import text_upper, text_truncate
    app.jinja_env.filters["text_truncate"] = text_truncate
    app.jinja_env.filters["text_upper"] = text_upper

    return app
Ejemplo n.º 7
0
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])

    db.init_app(app)
    login_manager.init_app(app)
    Bootstrap(app)

    from app import routes
    routes.load(app)

    @app.template_filter
    def upper_filter(text):
        return text.upper()

    return app
Ejemplo n.º 8
0
def create_app():
    app = Flask(__name__,
                template_folder=os.path.join(basedir, "resources",
                                             "templates"),
                static_folder=os.path.join(basedir, "resources", "static"))
    app.config["SECRET_KEY"] = 'secret'

    from app import routes
    routes.load(app)

    from app.filters import truncate
    app.jinja_env.filters["textTruncate"] = truncate

    def show_upper(text: str):
        return text.upper()

    @app.context_processor
    def inject_tempalte_function_and_variable():
        return dict(show_upper=show_upper,
                    testing='testing variable created in __init__.py files')

    return app
def create_app():
    app = Flask(__name__)
    load(app)
    return app
Ejemplo n.º 10
0
def creat_app():
    app = Flask(__name__)

    from app import routes
    routes.load(app)
    return app