摘要:import json from datetime import date, datetime class DateEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime): return obj.
阅读全文
摘要:配置云服务器登陆信息,可快速登陆,不用每次手动输入IP地址和密码 Host server1 HostName xxx.xxx.xxx.xxx User root IdentityFile ~/.ssh/id_rsa Host server2 HostName xxx.xxx.xxx.xxx User
阅读全文
摘要:Elasticsearch 聚合分析(Aggregations) Elasticsearch 聚合(Aggregations) 是一种强大的数据分析功能,类似于 SQL 的 GROUP BY,可以用于 统计、分组、计算平均值、最大值、最小值、直方图分析 等。 🔹 1. 聚合查询的基本结构 GET
阅读全文
摘要:1. 安装 1.1 通过homebrew安装 推荐使用 homebrew工具进行安装,简单又快捷 brew install minio 通过以上工具安装后,运行文件默认路径为:/opt/homebrew/bin 可以通过brew --prefix快速定位到安装目录 1.2 通过Docker安装 拉取
阅读全文
摘要:def index(): key=b"key" iv=b"iv" # 创建 AES 加密实例 cipher = AES.new(key, AES.MODE_CBC, iv) tenant = "tenant" account = "account" # 前端获取的子账号唯一标识,不可写死,不可为中文
阅读全文
摘要:在 macOS 上创建新的 Jupyter Notebook 内核(Kernel)并进行配置,一般需要使用 conda 或 virtualenv 创建一个新的 Python 环境,然后注册为 Jupyter 内核。以下是详细步骤: 1. 安装 Jupyter Notebook(如果尚未安装) 如果你
阅读全文
摘要:在 大型 FastAPI 项目 中,数据库迁移(Database Migration)功能通常使用 Alembic 进行管理,并且存放在 migrations/ 目录下。 1. 数据库迁移的目录结构 在 FastAPI 项目中,数据库迁移的目录结构如下: my_fastapi_project/ │─
阅读全文