from contextlib import asynccontextmanagerfrom fastapi import FastAPIglobal_vars={}@asynccontextmanagerasync def lifespan(app: FastAPI): some_var=s...
分类:python建站
3 篇文章首先:pip install gunicorn随后,在app入口文件所在目录下输入以下指令,开启 gunicorn,即可访问flask网站gunicorn -D -w 4 -b 0.0.0.0:8000 main:app-D 是后台运行 -w worker的数目,–bind 为主机地址和端口0.0....