更换数据库

This commit is contained in:
晓丰 2025-04-13 00:02:44 +08:00
parent 91d09e3934
commit 00bc2bdff5
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,2 @@
import pymysql
pymysql.install_as_MySQLdb()

View File

@ -75,8 +75,15 @@ WSGI_APPLICATION = 'ts_reshub.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'ENGINE': 'django.db.backends.mysql',
'NAME': 'tsreshub_db',
'USER': 'tsreshub_prod',
'PASSWORD': 'Tr5h$Prod!92@TsRH',
'HOST': '39.101.135.56',
'PORT': '3306',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
}
}
}