摘要:
一,代码 结构: py from flask import Blueprint,jsonify,render_template user = Blueprint('user', __name__) @user.route("/list/") def tech_news(): meta = { "ti 阅读全文
posted @ 2025-11-08 10:54
刘宏缔的架构森林
阅读(3)
评论(0)
推荐(0)
摘要:
一,代码 controller/admin.py from flask import Blueprint,jsonify admin = Blueprint('admin', __name__) # 用蓝图注册路由 @admin.route("/add/") def society_news(): 阅读全文
posted @ 2025-11-08 10:54
刘宏缔的架构森林
阅读(4)
评论(0)
推荐(0)
摘要:
一,默认的错误路径: 二,代码: from flask import Flask,jsonify app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' @app.errorhandler(404 阅读全文
posted @ 2025-11-08 10:54
刘宏缔的架构森林
阅读(1)
评论(0)
推荐(0)
摘要:
一,生成requirements.txt $ pip3 freeze > requirements.txt 查看效果 : $ more requirements.txt blinker==1.9.0 click==8.3.0 Flask==3.1.2 itsdangerous==2.2.0 Jinj 阅读全文
posted @ 2025-11-08 10:54
刘宏缔的架构森林
阅读(2)
评论(0)
推荐(0)
摘要:
一,安装jsonify $ pip3 install jsonify 二,返回json from flask import Flask,jsonify app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, Wo 阅读全文
posted @ 2025-11-08 10:52
刘宏缔的架构森林
阅读(2)
评论(0)
推荐(0)
摘要:
一,用pip3安装框架 $ pip3 install flask Collecting flask Downloading flask-3.1.2-py3-none-any.whl.metadata (3.2 kB) Collecting blinker>=1.9.0 (from flask) Do 阅读全文
posted @ 2025-11-08 10:52
刘宏缔的架构森林
阅读(2)
评论(0)
推荐(0)
摘要:
一,安装node 安装Node.js(推荐) 下载地址:https://nodejs.org 验证安装:node -v $ node -v v22.20.0 二,安装python库 $ pip install PyExecJS Collecting PyExecJS Downloading PyEx 阅读全文
posted @ 2025-11-08 10:52
刘宏缔的架构森林
阅读(3)
评论(0)
推荐(0)
浙公网安备 33010602011771号