change options to getenv params

This commit is contained in:
Basyrov Rustam
2025-06-04 23:30:25 +03:00
parent a753295b40
commit b4d26b608d

View File

@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/5.2/ref/settings/
""" """
from pathlib import Path from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@@ -78,11 +79,11 @@ WSGI_APPLICATION = "mysite.wsgi.application"
DATABASES = { DATABASES = {
"default": { "default": {
"ENGINE": "django.db.backends.postgresql", "ENGINE": "django.db.backends.postgresql",
"OPTIONS": { 'NAME': os.getenv('DATABASE_NAME', 'sa'),
"service": "my_service", 'USER': os.getenv('DATABASE_USERNAME', 'sa'),
"passfile": ".pgpass", "PASSWORD": os.getenv('DATABASE_PASSWORD', "example"),
}, 'HOST': os.getenv('DATABASE_HOST', 'db'),
"PASSWORD":"example", 'PORT': os.getenv('DATABASE_PORT', 5432),
} }
} }