摘要:
一,安装第三方库 $ pip3 install flask-wtf 二,例子 # validator from flask_wtf import FlaskForm import wtforms from wtforms import validators from wtforms.fields i 阅读全文
posted @ 2025-11-09 15:57
刘宏缔的架构森林
阅读(22)
评论(0)
推荐(0)
摘要:
一,报错信息 {'csrf_token': ['The CSRF token is missing.']} 二,解决 : 在相应的form中添加: class Meta: csrf = False 例子如下: class AddedForm(FlaskForm): name = StringFiel 阅读全文
posted @ 2025-11-09 15:39
刘宏缔的架构森林
阅读(31)
评论(0)
推荐(0)
摘要:
一,报错信息: RuntimeError: A secret key is required to use CSRF. 二,解决: 在app.py中增加: app.config['SECRET_KEY'] = "AABBCCDD" 阅读全文
posted @ 2025-11-09 14:45
刘宏缔的架构森林
阅读(14)
评论(0)
推荐(0)
摘要:
一,安装第三方库 $ pip3 install Flask-Caching redis 二,代码: 初始化cache import os from dotenv import load_dotenv from flask import Flask,jsonify from flask_sqlalch 阅读全文
posted @ 2025-11-09 12:42
刘宏缔的架构森林
阅读(26)
评论(0)
推荐(0)
摘要:
一,安装 # apt install redis 查看状态: # systemctl status redis.service ● redis-server.service - Advanced key-value store Loaded: loaded (/usr/lib/systemd/sys 阅读全文
posted @ 2025-11-09 11:33
刘宏缔的架构森林
阅读(19)
评论(0)
推荐(0)
摘要:
一,安装第三方库 $ pip3 install gunicorn gevent 二,使用 -D 后台运行(守护进程) -b 指定绑定地址和端口 -w 设置 4 个工作进程 $ gunicorn -D -b 127.0.0.1:8000 -w 4 app:app 测试 效果: 用ss查看端口是否已使用 阅读全文
posted @ 2025-11-09 10:37
刘宏缔的架构森林
阅读(36)
评论(0)
推荐(0)
摘要:
一,报错信息: RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods 二,解决: 原因是缺少cryptography库,导致建立到mysql 阅读全文
posted @ 2025-11-09 10:04
刘宏缔的架构森林
阅读(109)
评论(0)
推荐(0)
浙公网安备 33010602011771号