上一页 1 2 3 4 5 6 7 ··· 201 下一页
摘要: 一,要注意的环节: 用户的密码保存时不能用明文,要用bcrypt加密保存 有写库操作,要做try except,发生异常时要做写日志, 有多个参数,要用wtforms做参数的校验 二,代码 python代码: # 得到bcrypt加密后的密码 def get_password_hash(passwo 阅读全文
posted @ 2026-07-18 22:39 刘宏缔的架构森林 阅读(6) 评论(0) 推荐(0)
摘要: 一,代码和报错信息: 代码: <img class="mb-4 rounded-circle" src="{{ url_for('static', path='image/logo/logo_300.jpg') }}" alt="" width="100"> 报错信息 starlette.routi 阅读全文
posted @ 2026-07-17 19:05 刘宏缔的架构森林 阅读(3) 评论(0) 推荐(0)
摘要: 一,问题 报错信息: Unable to build URLs outside an active request without 'SERVER_NAME' configured. Also configure 'APPLICATION_ROOT' and 'PREFERRED_URL_SCHEM 阅读全文
posted @ 2026-07-17 14:26 刘宏缔的架构森林 阅读(3) 评论(0) 推荐(0)
摘要: 一,代码 # es分页搜索,通过关健词列表 def es_topic_search_by_list(qk_list): should_list = [] for qk in qk_list: qk_one = qk.strip() if qk_one == '': continue one_q1 = 阅读全文
posted @ 2026-07-14 21:52 刘宏缔的架构森林 阅读(4) 评论(0) 推荐(0)
摘要: 一,代码: base.html <!-- base.html --> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <!-- 预留标题块,并可以设置默认值 --> <title>{% block title %}我 阅读全文
posted @ 2026-07-12 23:16 刘宏缔的架构森林 阅读(5) 评论(0) 推荐(0)
摘要: 一,安装第三方库: $ pip install WTForms 二,代码 python: # app/api/users.py from fastapi import APIRouter, Depends from starlette.requests import Request from sta 阅读全文
posted @ 2026-07-12 23:16 刘宏缔的架构森林 阅读(4) 评论(0) 推荐(0)
摘要: OpenCode、OpenAI Codex 与 Claude Code 是目前主流的三大终端级(CLI/Agent)AI 编程工具。它们都支持直接在你的本地终端和代码库中运行,通过自然语言自动修改文件、运行测试、甚至自主定位 Bug。但在开源程度、核心逻辑、以及具体的适用场景上,三者存在明显的区别。 阅读全文
posted @ 2026-07-12 23:16 刘宏缔的架构森林 阅读(28) 评论(0) 推荐(0)
摘要: 一,代码 jwt功能模块和用户登录的两个依赖项: import hashlib from datetime import datetime, timedelta, timezone from typing import Optional from fastapi import FastAPI, De 阅读全文
posted @ 2026-06-29 20:09 刘宏缔的架构森林 阅读(2) 评论(0) 推荐(0)
摘要: 一,代码: plugin: from starlette.requests import Request from starlette_context.plugins import Plugin class PythonRequestPlugin(Plugin): # 1. 定义在 context 阅读全文
posted @ 2026-06-29 20:09 刘宏缔的架构森林 阅读(7) 评论(0) 推荐(0)
摘要: 一,安装第三方库 库地址: https://pypi.org/project/starlette-context/ 安装: $ pip install starlette-context 二,代码 1,登录后把用户信息保存到上下文中 from starlette_context.plugins im 阅读全文
posted @ 2026-06-29 20:09 刘宏缔的架构森林 阅读(8) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 201 下一页