Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 更新审计 mysql 依赖包,将 mysqlclient 切换 pymysql #438

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading