fix: 支持生产环境外部数据库 6.6.6.66,移除本地 PostgreSQL 容器
All checks were successful
Deploy to Server / deploy (push) Successful in 1m7s
All checks were successful
Deploy to Server / deploy (push) Successful in 1m7s
This commit is contained in:
@@ -108,7 +108,7 @@ DATABASES = {
|
||||
#从环境变量获取数据库配置 (Docker 环境会自动注入这些变量。
|
||||
# 只有当 DB_HOST 被明确设置且不为空时才使用 PostgreSQL
|
||||
DB_HOST = os.environ.get('DB_HOST', '')
|
||||
if DB_HOST and DB_HOST != '6.6.6.66':
|
||||
if DB_HOST:
|
||||
DATABASES['default'] = {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': os.environ.get('DB_NAME', 'market'),
|
||||
|
||||
Reference in New Issue
Block a user