# fastapi-demo **Repository Path**: power9508/fastapi-demo ## Basic Information - **Project Name**: fastapi-demo - **Description**: FastAPI 的学习笔记 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2024-09-23 - **Last Updated**: 2025-02-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ```bash # 创建虚拟环境 ~= node_modules python -m venv .venv .\.venv\Scripts\activate # 标准版:没有附加功能(如数据库、JWT、CORS 等) pip install "fastapi[standard]" # 完整版:还有 sqlalchemy(ORM) databases(异步数据库支持)其他与身份验证、CORS、文件处理等相关的库。 pip install "fastapi[all]" # 开发环境 fastapi dev main.py # 生产环境 fastapi run main.py ``` ``` 如果 http://127.0.0.1:8000/docs 打不开或很慢 D:\git\fastapi-demo\.venv\Lib\site-packages\fastapi\openapi\docs.py 查找 `cdn.jsdelivr.net` 替换 `testingcf.jsdelivr.net` ``` ```bash git config --global user.name "Power9508" git config --global user.email "258345234@qq.com" # 创建 git 仓库 mkdir fastapi-demo cd fastapi-demo git init touch README.md git add README.md git commit -m "first commit" git remote add origin https://gitee.com/power9508/fastapi-demo.git git push -u origin "master" # 已有仓库 cd fastapi-demo git remote add origin https://gitee.com/power9508/fastapi-demo.git git push -u origin "master" ```