From 750f58dfbfbed6fc920c9a1406bef321b65cfe7a Mon Sep 17 00:00:00 2001 From: raja <1647193241@qq.com> Date: Wed, 25 Sep 2024 00:08:23 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=93=9D=E9=B2=B8=20SaaS=20Python=20?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=A1=86=E6=9E=B6=20mysqlclient=20=E5=88=87?= =?UTF-8?q?=E6=8D=A2=20pymysql=20--story=3D119849198?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/config/default.py | 4 ++++ src/backend/requirements.txt | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/backend/config/default.py b/src/backend/config/default.py index 48509928..b8cf316c 100644 --- a/src/backend/config/default.py +++ b/src/backend/config/default.py @@ -18,6 +18,7 @@ import sys +import pymysql from bk_audit.constants.utils import LOGGER_NAME from bkcrypto.constants import AsymmetricCipherType, SymmetricCipherType from blueapps.conf.default_settings import * # noqa @@ -64,6 +65,9 @@ "apigw_manager.apigw.authentication.ApiGatewayJWTUserMiddleware", # JWT 透传的用户信息 ) +# pysql 初始化 +pymysql.install_as_MySQLdb() + # 默认数据库自增字段 DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/src/backend/requirements.txt b/src/backend/requirements.txt index 78045b33..a47be7ed 100644 --- a/src/backend/requirements.txt +++ b/src/backend/requirements.txt @@ -8,6 +8,8 @@ bk_audit[opentelemetry]==1.2.2b0 bk_resource==0.4.11 +blueapps>=4.14.0 + # web server gunicorn==22.0.0 @@ -24,7 +26,7 @@ drf_spectacular==0.12.0 django-environ==0.10.0 django-simpleui==2023.3.1 django-sslserver==0.22 -mysqlclient==2.1.1 +pymysql==1.1.1 # staticfiles whitenoise==5.2.0