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 25, 2024
1 parent 6002681 commit 43e18e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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
4 changes: 4 additions & 0 deletions src/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from warnings import warn

import environ
import pymysql

# 读取环境变量文件
# 配置优先级 环境变量 -> .env文件 -> settings.py
Expand All @@ -48,6 +49,9 @@
sys.path.append(os.path.join(os.getcwd(), f"services/{DEPLOY_SERVICE}"))
sys.path.append(os.path.join(os.getcwd(), "apps"))

# pysql 初始化
pymysql.install_as_MySQLdb()


def load_settings(module_path: str, raise_exception: bool = True):
try:
Expand Down

0 comments on commit 43e18e2

Please sign in to comment.