摘要:
1.JWT认证 from datetime import datetime, timedelta from passlib.context import CryptContext from jose import JWTError, jwt SECRET_KEY = "60a633523fb4358 阅读全文
摘要:
1.函数依赖注入简单示例 from typing import Optional import uvicorn from fastapi import FastAPI, Depends async def common_parameters(q: Optional[str] = None, page 阅读全文
摘要:
1.路径操做配置 @app.post( "/path_operation_configuration", response_model=xxx, # 接口描述,一般放在`app.include_router`里面,做一个模块划分 # 如果有有多个,则在文档中国该接口会分别展示多条 tags=['pa 阅读全文
摘要:
静态文件配置 import os from pathlib import Path from fastapi import FastAPI import uvicorn from fastapi.staticfiles import StaticFiles app = FastAPI() base_ 阅读全文