参考网址 : 基本照着网址走一遍就行,重点是红色字段

https://fastapi.tiangolo.com/
  • 1,初始化  安装组件

pip install fastapi

pip install uvicorn

 

  • 2,发布服务 

uvicorn main:app --reload

python 个人笔记-----fastapi简单发布,好用的网址,看参考网址

这个语法一定要在你MAIN这个包里面才行,要不你怎么输入都是错误提示,一定要先找好路径

python 个人笔记-----fastapi简单发布,好用的网址,看参考网址

  • 3  粘下测试代码   手打一下,不多,或者网址里面找下,都在fastapi网站第一页里面

python 个人笔记-----fastapi简单发布,好用的网址,看参考网址

python 个人笔记-----fastapi简单发布,好用的网址,看参考网址

  • 5后面的就是测试地址了,可以本地调用试下了

相关文章:

  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2022-03-01
  • 2022-12-23
  • 2022-01-23
猜你喜欢
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-06-16
  • 2021-12-21
相关资源
相似解决方案