代码拉取完成,页面将自动刷新
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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。