
FastAPI
恒云客
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
FastAPI应用加入Nacos
FastAPI应用加入Nacos原创 2022-07-21 07:13:38 · 1748 阅读 · 1 评论 -
FastApi通过nacos注册 实现SpringCloudGateway服务调用
安装依赖 pipenv install apscheduler pipenv install nacos-sdk-python 编写注册方法 app/nacos.py import nacos from .settings import settings client = nacos.NacosClient( settings.SERVER_HOST, namespace=settings.SERVER_NAMESPACE_ID) async def beat():原创 2021-08-15 14:49:01 · 2522 阅读 · 0 评论 -
FastAPI实现JWT验证
fastapi是一个异步编程框架,有非常不错的性能,本文介绍如何在 fastapi中实现jwt验证功能 1. 添加依赖 pipenv install pyjwt 'passlib[bcrypt]' 2. 编写一个handle处理jwt所需功能 app/auth.py import jwt from fastapi import HTTPException, Security from fastapi.security import HTTPAuthorizationCredentials,原创 2021-08-12 11:45:11 · 2544 阅读 · 1 评论 -
FastAPI 生产部署
开发部署 安装asgi插件 pipenv install uvicorn # main.py from fastapi import FastApi app=FastApi() @app.get('/hello') async def hello(): return {'message':'hello World'} nvicorn main:app --reload 开发模式下运行 热加载 生产环境部署 CentOS8.x +Nginx 安装插件 pipenv inst原创 2021-07-31 10:25:51 · 2216 阅读 · 0 评论