上一页 1 2 3 4 5 6 7 8 ··· 51 下一页
摘要: 全局routes参数的使用 from fastapi import FastAPI, Request from fastapi.response import JSONResponse from fastapi.routing import APIRoute async def fastapi_in 阅读全文
posted @ 2024-02-28 16:44 我在路上回头看 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 如何关闭交互式文档 from fastapi import FastAPI app = FastAPI( docs_url=None, redoc_url=None, openapi_url=None, ) 阅读全文
posted @ 2024-02-28 16:43 我在路上回头看 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 开启调试模式 from fastapi import FastAPI from fastapi.responses import PlainTextResponse app = FastAPI(debug=True) # 生产环境关闭 @app.get('/') def index(): 1988/ 阅读全文
posted @ 2024-02-28 16:41 我在路上回头看 阅读(113) 评论(0) 推荐(0) 编辑
摘要: FastAPI类参数说明 def __init__( self, *, debug: bool = False, # 是否启动调试模式 routes: Optional[List[BaseRoute]] = None, #自定义路由列表 title: str = "FastAPI", # api文档 阅读全文
posted @ 2024-02-28 16:40 我在路上回头看 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 安装 pip3 install fastapi pip3 install uvicorn[standard] # 是一个ASGI异步服务器网关接口服务器框架 pip3 install python-multipart #处理表单参数的 # 完整安装 pip install fastapi[all] 阅读全文
posted @ 2024-02-28 16:39 我在路上回头看 阅读(112) 评论(0) 推荐(0) 编辑
摘要: HTTPException介绍 HTTPException是FastAPI中用于处理HTTP错误的异常类。当你在处理请求时遇到异常情况,可以抛出HTTPException, FastAPI将自动使用合适的HTTP状态码和响应体返回给客户端。以下是一些详细的说明: HTTPException是一个派生 阅读全文
posted @ 2024-02-26 22:03 我在路上回头看 阅读(899) 评论(0) 推荐(0) 编辑
摘要: 版本 python3.11版本,aioredis 2.0.1版本,redis 7.x版本 redis.conf配置文件 daemonize yes bind 0.0.0.0 port 6379 protected-mode no 代码 from fastapi import FastAPI impo 阅读全文
posted @ 2024-02-25 02:19 我在路上回头看 阅读(362) 评论(1) 推荐(0) 编辑
摘要: 将文件系统挂载到目录 语法格式:mount 参数 设备名 目录名 常用参数 -a 加载/etc/fstab文件记录的所有文件系统 -r 将文件系统设置为只读模式 -F 为每个设备创建出一个新的挂载版本 -t 挂载指定文件类型的设备分区 -h 显示帮助信息 -U 挂载指定UUID的设备分区 -l 显示 阅读全文
posted @ 2023-12-25 12:20 我在路上回头看 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 安全的远程连接服务 语法格式:ssh 参数 域名或ip地址 常用参数 -1 使用ssh协议版本1 -i 设置密钥文件 -2 使用ssh协议版本2 -l 设置登录用户名 -4 基于IPV4网络协议 -N 不执行远程命令 -6 基于IPV6网络协议 -o 设置配置参数选项 -a 关闭认证代理连接转发功能 阅读全文
posted @ 2023-12-25 12:14 我在路上回头看 阅读(12) 评论(0) 推荐(0) 编辑
摘要: pwd命令 显示当前工作目录的路径 语法格式:pwd 参数 常用参数 -L 显示逻辑路径 --version 显示版本信息 -P 显示实际物理地址 --help 显示帮助信息 参考示例 查看当前工作目录路径 [root@liuwei ~]# pwd /root 阅读全文
posted @ 2023-12-25 12:05 我在路上回头看 阅读(2) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 51 下一页