mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-29 23:44:41 +00:00
取消aioredis包的使用,改用redis,解决不兼容python3.10以上版本的问题
This commit is contained in:
@@ -108,7 +108,7 @@ fastapi_vue3_admin
|
|||||||
|
|
||||||
| 类型 | 技术栈 | 版本 |
|
| 类型 | 技术栈 | 版本 |
|
||||||
|----------|------------|------------|
|
|----------|------------|------------|
|
||||||
| 后端 | Python | 3.10(大于3.10的版本, 会有兼容问题, 将来升级,暂时不考虑升级) |
|
| 后端 | Python | 3.10 |
|
||||||
| 后端 | FastAPI | 0.109 |
|
| 后端 | FastAPI | 0.109 |
|
||||||
| 前端 | Node.js | >= 20.0(推荐使用最新版)|
|
| 前端 | Node.js | >= 20.0(推荐使用最新版)|
|
||||||
| 前端 | npm | 16.14 |
|
| 前端 | npm | 16.14 |
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from fastapi import APIRouter, Depends
|
from fastapi import APIRouter, Depends
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.core.dependencies import AuthPermission, redis_getter
|
from app.core.dependencies import AuthPermission, redis_getter
|
||||||
from app.api.v1.services.monitor.cache_service import CacheService
|
from app.api.v1.services.monitor.cache_service import CacheService
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
from fastapi import APIRouter, Body, Depends
|
from fastapi import APIRouter, Body, Depends
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.core.dependencies import AuthPermission, redis_getter
|
from app.core.dependencies import AuthPermission, redis_getter
|
||||||
from app.core.logger import logger
|
from app.core.logger import logger
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from typing import Union, Dict
|
|||||||
from fastapi import APIRouter, Depends, Request, BackgroundTasks, WebSocket
|
from fastapi import APIRouter, Depends, Request, BackgroundTasks, WebSocket
|
||||||
from fastapi.responses import JSONResponse, StreamingResponse
|
from fastapi.responses import JSONResponse, StreamingResponse
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.config.setting import settings
|
from app.config.setting import settings
|
||||||
from app.common.response import ErrorResponse, SuccessResponse
|
from app.common.response import ErrorResponse, SuccessResponse
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from fastapi import APIRouter, Body, Depends, Path, Query, Request, UploadFile
|
from fastapi import APIRouter, Body, Depends, Path, Query, Request, UploadFile
|
||||||
from fastapi.responses import JSONResponse, StreamingResponse
|
from fastapi.responses import JSONResponse, StreamingResponse
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.api.v1.params.system.config_param import ConfigQueryParams
|
from app.api.v1.params.system.config_param import ConfigQueryParams
|
||||||
from app.common.request import PaginationService
|
from app.common.request import PaginationService
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import json
|
import json
|
||||||
from fastapi import APIRouter, Body, Depends, Path, Query
|
from fastapi import APIRouter, Body, Depends, Path, Query
|
||||||
from fastapi.responses import JSONResponse, StreamingResponse
|
from fastapi.responses import JSONResponse, StreamingResponse
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.common.response import StreamResponse, SuccessResponse
|
from app.common.response import StreamResponse, SuccessResponse
|
||||||
from app.core.base_params import PaginationQueryParams
|
from app.core.base_params import PaginationQueryParams
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.common.enums import RedisInitKeyConfig
|
from app.common.enums import RedisInitKeyConfig
|
||||||
from app.api.v1.schemas.monitor.cache_schema import CacheMonitorSchema, CacheInfoSchema
|
from app.api.v1.schemas.monitor.cache_schema import CacheMonitorSchema, CacheInfoSchema
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List, Optional
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.common.enums import RedisInitKeyConfig
|
from app.common.enums import RedisInitKeyConfig
|
||||||
from app.core.exceptions import CustomException
|
from app.core.exceptions import CustomException
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import json
|
|||||||
import uuid
|
import uuid
|
||||||
from typing import Dict, Union, NewType
|
from typing import Dict, Union, NewType
|
||||||
from fastapi import Request
|
from fastapi import Request
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from user_agents import parse
|
from user_agents import parse
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
import json
|
import json
|
||||||
from typing import Any, Dict, List, Union
|
from typing import Any, Dict, List, Union
|
||||||
|
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
from fastapi import UploadFile
|
from fastapi import UploadFile
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.api.v1.params.system.config_param import ConfigQueryParams
|
from app.api.v1.params.system.config_param import ConfigQueryParams
|
||||||
from app.api.v1.schemas.system.auth_schema import AuthSchema
|
from app.api.v1.schemas.system.auth_schema import AuthSchema
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import Any, List, Dict
|
from typing import Any, List, Dict
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
|
|
||||||
from app.api.v1.schemas.system.auth_schema import AuthSchema
|
from app.api.v1.schemas.system.auth_schema import AuthSchema
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import aioredis
|
from redis import asyncio as aioredis
|
||||||
from motor.motor_asyncio import AsyncIOMotorClient
|
from motor.motor_asyncio import AsyncIOMotorClient
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from sqlalchemy import create_engine, inspect, text
|
from sqlalchemy import create_engine, inspect, text
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
from typing import AsyncGenerator, Optional
|
from typing import AsyncGenerator, Optional
|
||||||
from fastapi import Depends, Request
|
from fastapi import Depends, Request
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import pickle
|
import pickle
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
from aioredis import Redis
|
from redis.asyncio.client import Redis
|
||||||
|
|
||||||
from app.core.logger import logger
|
from app.core.logger import logger
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ greenlet==3.1.1 # 协程框架
|
|||||||
bcrypt==4.0.1 # 密码加密解析
|
bcrypt==4.0.1 # 密码加密解析
|
||||||
aiofiles==24.1.0 # 文件操作
|
aiofiles==24.1.0 # 文件操作
|
||||||
redis==5.2.1 # redis 同步操作数据库(用户celery配套使用)
|
redis==5.2.1 # redis 同步操作数据库(用户celery配套使用)
|
||||||
aioredis==2.0.1 # redis 异步操作数据库
|
# aioredis==2.0.1 # redis 异步操作数据库 redis已经完全具备了aioredis的功能,无需重复安全,且aioredis已经不再维护也不兼容3.10+的版本
|
||||||
aiosqlite==0.17.0 # sqlite 异步操作数据库
|
aiosqlite==0.17.0 # sqlite 异步操作数据库
|
||||||
asyncmy==0.2.9 # mysql 异步操作数据库:基于 mysqlclient:asyncmy 是 mysqlclient 的异步版本,mysqlclient 是一个 C 语言编写的 MySQL 客户端,性能较高。性能:asyncmy 通常在性能上优于 aiomysql,特别是在高并发和大数据量的场景下。
|
asyncmy==0.2.9 # mysql 异步操作数据库:基于 mysqlclient:asyncmy 是 mysqlclient 的异步版本,mysqlclient 是一个 C 语言编写的 MySQL 客户端,性能较高。性能:asyncmy 通常在性能上优于 aiomysql,特别是在高并发和大数据量的场景下。
|
||||||
motor==3.6.0 # mongodb 驱动
|
motor==3.6.0 # mongodb 驱动
|
||||||
|
|||||||
Reference in New Issue
Block a user