随笔 - 10,  文章 - 0,  评论 - 0,  阅读 - 8288
09 2023 档案
FastAPI.9
摘要:# Alembic ## 一、什么是Alembic 1. Alembic是一种用于数据迁移和版本控制的工具,特别适用于Python编写的数据库应用程序。它允许你按照预定的数据库模型定义,在不丢失现有数据的情况下进行数据库模式的更改。 2. Alembic的一些关键概念和功能 ``` 1. 迁移文件( 阅读全文
posted @ 2023-09-06 17:06 zhangbinn 阅读(255) 评论(0) 推荐(0) 编辑
FastAPI.8
摘要:# FastAPI之连接数据库 ### 1.databases.py ```python from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarat 阅读全文
posted @ 2023-09-05 16:47 zhangbinn 阅读(10) 评论(0) 推荐(0) 编辑
FastAPI.7
摘要:# FastAPI的Post请求 ### 1.接受query参数 ```python from fastapi import FastAPI, Query @app.post('/login') def login(username: str = Query(...), password: str 阅读全文
posted @ 2023-09-05 16:15 zhangbinn 阅读(27) 评论(0) 推荐(0) 编辑
FastAPI.6
摘要:## FastApi用pillow生成随机四位数字验证码图片 1. 导入模块 ```python import random from fastapi import FastAPI,Response from PIL import Image, ImageDraw, ImageFont from i 阅读全文
posted @ 2023-09-05 10:36 zhangbinn 阅读(77) 评论(0) 推荐(0) 编辑
FastAPI.5
摘要:# FastAPI中async def 和def的区别 ### 在FastAPI中,async def和def之间具有一些区别。 1. `异步支持`: async def定义的函数可以是异步函数,它们可以使用await关键字暂停执行并等待其他协程完成。而def定义的函数是同步函数,它们的执行是顺序的 阅读全文
posted @ 2023-09-01 10:56 zhangbinn 阅读(374) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示