示例#1
0
def create_app():
    app = Flask(__name__)
    CORS(app)

    config.init_app(app)
    database.init_app(app)
    migration.init_app(app)
    views.init_app(app)

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

    app.config["SQLALCHEMY_DATABASE_URI"] = getenv("SQLALCHEMY_DATABASE_URI")
    app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
    app.config["JSON_SORT_KEYS"] = False

    database.init_app(app)
    migrations.init_app(app)
    views.init_app(app)

    return app
示例#3
0
def create_app(config_name="production"):
    app = Flask(__name__)

    app.config.from_object(config_selector[config_name])

    database.init_app(app)
    migration.init_app(app)
    commands.init_app(app)
    authentication.init_app(app)
    views.init_app(app)

    return app
示例#4
0
def create_app():

    app = Flask(__name__)
    config_setup = getenv("FLASK_ENV")
    app.config.from_object(config_selector[config_setup])
    database.init_app(app)
    migration.init_app(app)
    serializer.init_app(app)
    authentication.init_app(app)
    views.init_app(app)

    return app
示例#5
0
def create_app():

    app = Flask(__name__)

    config_type = getenv("FLASK_ENV")
    app.config.from_object(config_selector[config_type])
    commands.init_app(app)
    database.init_app(app)
    views.init_app(app)
    serialization.init_app(app)
    CORS(app)

    return app
示例#6
0
def create_app():
    app = Flask(__name__)
    CORS(app)
    # CORS(app, resources={r"/api/*": {"origins": "*"}})
    config_type = getenv("FLASK_ENV")
    app.config.from_object(config_selector[config_type])
    commands.init_app(app)
    database.init_app(app)
    migration.init_app(app)
    authentication.init_app(app)
    views.init_app(app)
    serialization.init_app(app)

    return app
示例#7
0
def create_app():
    app = Flask(__name__)

    from app import configurations
    from app.configurations import database, migration, views, authentication

    configurations.init_app(app)
    database.init_app(app)
    migration.init_app(app)
    authentication.init_app(app)
    views.init_app(app)

    @app.route("/")
    def hello_flask():
        return {"msg": "Hello Flask!"}, 200

    return app