上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 214 下一页
摘要: 一,代码和报错信息: 代码: <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 刘宏缔的架构森林 阅读(10) 评论(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 刘宏缔的架构森林 阅读(10) 评论(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 刘宏缔的架构森林 阅读(8) 评论(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 刘宏缔的架构森林 阅读(12) 评论(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 刘宏缔的架构森林 阅读(8) 评论(0) 推荐(0)
摘要: OpenCode、OpenAI Codex 与 Claude Code 是目前主流的三大终端级(CLI/Agent)AI 编程工具。它们都支持直接在你的本地终端和代码库中运行,通过自然语言自动修改文件、运行测试、甚至自主定位 Bug。但在开源程度、核心逻辑、以及具体的适用场景上,三者存在明显的区别。 阅读全文
posted @ 2026-07-12 23:16 刘宏缔的架构森林 阅读(129) 评论(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 刘宏缔的架构森林 阅读(4) 评论(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 刘宏缔的架构森林 阅读(23) 评论(0) 推荐(0)
摘要: 一,安装第三方库 库地址: https://pypi.org/project/starlette-context/ 安装: $ pip install starlette-context 二,代码 1,登录后把用户信息保存到上下文中 from starlette_context.plugins im 阅读全文
posted @ 2026-06-29 20:09 刘宏缔的架构森林 阅读(15) 评论(0) 推荐(0)
摘要: 一,代码 说明:只针对admin管理后台,不影响其他子应用如api basic的代码 # app/core/adminbasic.py import secrets from fastapi import FastAPI, Depends, HTTPException, status from fa 阅读全文
posted @ 2026-06-29 20:09 刘宏缔的架构森林 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 214 下一页