Skip to content

Commit

Permalink
chore: 蓝鲸 SaaS Python 开发框架 mysqlclient 切换 pymysql --story=119849198
Browse files Browse the repository at this point in the history
  • Loading branch information
0RAJA committed Sep 24, 2024
1 parent 6002681 commit 750f58d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/backend/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,6 +65,9 @@
"apigw_manager.apigw.authentication.ApiGatewayJWTUserMiddleware", # JWT 透传的用户信息
)

# pysql 初始化
pymysql.install_as_MySQLdb()

# 默认数据库自增字段
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

Expand Down
4 changes: 3 additions & 1 deletion src/backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 750f58d

Please sign in to comment.