diff --git a/src/backend/requirements.txt b/src/backend/requirements.txt index 78045b3..4458f70 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 diff --git a/src/backend/settings.py b/src/backend/settings.py index 11b321a..cdba05f 100644 --- a/src/backend/settings.py +++ b/src/backend/settings.py @@ -23,6 +23,7 @@ from warnings import warn import environ +import pymysql # 读取环境变量文件 # 配置优先级 环境变量 -> .env文件 -> settings.py @@ -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: