摘要:
节点元数据参数说明 # 拿app.get()方法的参数来说明,其他的差不多类似 def get( self, path: str, *, response_model: Optional[Type[Any]] = None, status_code: Optional[int] = None, ta 阅读全文
posted @ 2024-02-28 16:46
我在路上回头看
阅读(92)
评论(0)
推荐(0)
摘要:
全局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
我在路上回头看
阅读(135)
评论(0)
推荐(0)
摘要:
如何关闭交互式文档 from fastapi import FastAPI app = FastAPI( docs_url=None, redoc_url=None, openapi_url=None, ) 阅读全文
posted @ 2024-02-28 16:43
我在路上回头看
阅读(311)
评论(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
我在路上回头看
阅读(543)
评论(0)
推荐(0)
摘要:
FastAPI类参数说明 def __init__( self, *, debug: bool = False, # 是否启动调试模式 routes: Optional[List[BaseRoute]] = None, #自定义路由列表 title: str = "FastAPI", # api文档 阅读全文
posted @ 2024-02-28 16:40
我在路上回头看
阅读(347)
评论(0)
推荐(0)
摘要:
安装 pip3 install fastapi pip3 install uvicorn[standard] # 是一个ASGI异步服务器网关接口服务器框架 pip3 install python-multipart #处理表单参数的 # 完整安装 pip install fastapi[all] 阅读全文
posted @ 2024-02-28 16:39
我在路上回头看
阅读(340)
评论(0)
推荐(0)