随笔分类 - FastAPI
摘要:from fastapi import FastAPI BOOKS = [ {"id": 1, "title": "book1"}, {"id": 2, "title": "book2"}, {"id": 3, "title": "book3"}, {"id": 4, "title": "book4
阅读全文
摘要:from fastapi import FastAPI app= FastAPI() # 静态路由优先级高于动态路由 # 必须写在动态路由的前面 @app.get("/books/most_populer") def books_most_populer(): return {"This Book
阅读全文
摘要:from fastapi import FastAPI app= FastAPI() # 静态路由模式 @app.get("/login") def login(): return {"msg":"Welcome CoCo Login"} @app.get("/books/{number}") #
阅读全文
摘要:1. 安装依赖 pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com python-multipart 2. 表单程序 . ├── post_test_1.py └── templates ├── i
阅读全文
摘要:1. 插件库 pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com jinja2 aiofiles 2. 模板渲染程序 2.1 Python程序 # _*_ coding: UTF-8 _*_ fro
阅读全文
摘要:1. 环境搭建 https://www.cnblogs.com/leoshi/p/15567193.html /root/.pyenv/versions/3.9.14/bin/python3.9 -m pip install -i http://pypi.douban.com/simple/ --t
阅读全文
浙公网安备 33010602011771号