上一页 1 2 3 4 5 6 7 8 9 ··· 201 下一页
摘要: 一,报错信息: 运行时报:KeyError: 'app.tasks.my_cron.clear_expired_sessions' app.tasks.my_cron.clear_expired_sessions在这里是代码中指定的任务的名称,代码如下: # 注册一个定时清理或检查的任务 @cele 阅读全文
posted @ 2026-06-21 13:08 刘宏缔的架构森林 阅读(4) 评论(0) 推荐(0)
摘要: 一,安装第三方库 $ pip install celery redis 二,代码: # app/tasks/my_cron.py # app/tasks/my_cron.py import datetime from celery_app import celery_app from app.cor 阅读全文
posted @ 2026-06-21 13:08 刘宏缔的架构森林 阅读(3) 评论(0) 推荐(0)
摘要: 一,安装要用到的库 $ pip install celery redis 二,代码 celery_app from celery import Celery celery_app = Celery( "worker", broker="redis://localhost:6379/0", backe 阅读全文
posted @ 2026-06-21 13:08 刘宏缔的架构森林 阅读(5) 评论(0) 推荐(0)
摘要: 一,查看pypi站点上fastapi的页面 https://pypi.org/project/fastapi/ 如图: 拉到下方查看对python版本的需求: 阅读全文
posted @ 2026-06-18 10:08 刘宏缔的架构森林 阅读(6) 评论(0) 推荐(0)
摘要: 一,报错信息: $ git status On branch master Your branch is ahead of 'origin/master' by 630 commits. (use "git push" to publish your local commits) You have 阅读全文
posted @ 2026-06-18 10:08 刘宏缔的架构森林 阅读(19) 评论(0) 推荐(0)
摘要: 一,安装所需的库 $ pip install typer 二,代码: run_cli.py # run_cli.py import typer from app.commands import calc_util # 创建总的 Typer 实例 app = typer.Typer(help="基于t 阅读全文
posted @ 2026-06-18 10:07 刘宏缔的架构森林 阅读(4) 评论(0) 推荐(0)
摘要: 一,代码: .env APP_NAME="My FastAPI App" LOGS_DIR="/data/fastapi/test123/logs" ITEMS_PER_PAGE=20 解析类: # app/core/Setttins.py from pydantic_settings import 阅读全文
posted @ 2026-06-18 10:07 刘宏缔的架构森林 阅读(4) 评论(0) 推荐(0)
摘要: 一,问题: Elasticsearch 中 IK 分词器将“狮猫精酿”错误切分为“狮 猫精 酿”的问题,你需要在 IK 分词器的自定义扩展词典中添加“狮猫”和“精酿”,以确保分词器能够正确识别这两个词组。 二,解决: 1. 找到 IK 插件的配置目录 进入你的 Elasticsearch 安装目录, 阅读全文
posted @ 2026-06-18 10:07 刘宏缔的架构森林 阅读(16) 评论(0) 推荐(0)
摘要: 一,报错: ERROR [flask_migrate] Error: Multiple heads are present; please specify a single target revision 完整的报错信息: $ flask db stamp head /data/python/fla 阅读全文
posted @ 2026-06-18 10:07 刘宏缔的架构森林 阅读(5) 评论(0) 推荐(0)
摘要: 一,报错信息 File "/data/python/flask/panda-sys/venv/lib/python3.10/site-packages/alembic/script/revision.py", line 768, in _resolve_revision_number self._r 阅读全文
posted @ 2026-06-18 10:06 刘宏缔的架构森林 阅读(6) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 201 下一页