2 Star 0 Fork 1

sjing108/small-flask-web

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
app.py 665 Bytes
一键复制 编辑 原始数据 按行查看 历史
monkey 提交于 2023-08-01 23:02 . update app.py
import os, sys
from config.setting import SERVER_PORT
from pkg.route.user_rest import user_api
from flasgger import Swagger
from flask import Flask
# 项目根路径
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, BASE_PATH) # 将项目根路径临时加入环境变量,程序退出后失效
app = Flask(__name__)
app.register_blueprint(user_api)
app.config["JSON_AS_ASCII"] = False # jsonify返回的中文正常显示
Swagger(app)
if __name__ == '__main__':
# host为主机ip地址,port指定访问端口号,debug=True设置调试模式打开
app.run(host="0.0.0.0", port=SERVER_PORT, debug=True)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/sjing108/small-flask-web.git
git@gitee.com:sjing108/small-flask-web.git
sjing108
small-flask-web
small-flask-web
master

搜索帮助