server.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:aws-sg-mngr 作者: mkazin 项目源码 文件源码
def initialize_app():
    app.logger.setLevel(logging.DEBUG)
    file_handler = RotatingFileHandler(
        'flask.log', maxBytes=1024 * 1024 * 100, backupCount=3)
    file_handler.setLevel(logging.DEBUG)
    app.logger.addHandler(file_handler)

    initialize_db()

    # Set up the flast_restplus API
    # See
    # http://michal.karzynski.pl/blog/2016/06/19/building-beautiful-restful-apis-using-flask-swagger-ui-flask-restplus/
    blueprint = Blueprint('api', __name__, url_prefix='/api')
    api.init_app(blueprint)

    # api.add_namespace(sgs_namespace)
    # api.add_namespace(cidrs_namespace)

    app.register_blueprint(blueprint)


# Set up Swagger Docs
# See http://github.com/rantav/flask-restful-swagger
# NOTE: this may not be needed. See if flask_restplus already provides this
# api = swagger.docs(Api(app), apiVersion='0.1')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号