fastApi
官网:https://fastapi.tiangolo.com/zh/#_2
源码:https://github.com/fastapi/fastapi
指定版本安装:

入门案例:
from fastapi import FastAPI app = FastAPI() @app.get('/hello') async def hello(): return {"message": "Hello World"} if __name__ == '__main__': import uvicorn uvicorn.run(app,host='localhost',port=8000)

启动方式二:命令启动(uvicorn filename:app_name --reload)

示例:uvicorn test:app --reload
其他启动方式:
fastapi dev filename.py (需要安装pip install "fastapi[standard]")

浙公网安备 33010602011771号