Skip to content

Commit

Permalink
fix: 添加 pymysql 配置 (#1617)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayuan929 authored Sep 23, 2024
1 parent 2b932b2 commit a8537ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apiserver/paasng/paasng/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from pathlib import Path
from typing import Any, Dict, List, Optional

import pymysql
from bkpaas_auth.core.constants import ProviderType
from django.contrib import messages
from django.utils.encoding import force_bytes, force_str
Expand Down Expand Up @@ -84,6 +85,10 @@

_notset = object()

pymysql.install_as_MySQLdb()
# Patch version info to forcely pass Django client check
setattr(pymysql, "version_info", (1, 4, 2, "final", 0))

# 蓝鲸数据库内容加密私钥
# 使用 `from cryptography.fernet import Fernet; Fernet.generate_key()` 生成随机秘钥
# 详情查看:https://cryptography.io/en/latest/fernet/
Expand Down

0 comments on commit a8537ed

Please sign in to comment.