chore: switch database backend from SQLite to PostgreSQL
Replace SQLite database configuration with PostgreSQL to improve scalability and production readiness. PostgreSQL configuration uses environment variables (POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, POSTGRES_PORT) for flexible deployment across different environments.
This commit is contained in:
parent
570f5d8fc8
commit
0a5a5fa800
@ -77,24 +77,24 @@ if not DEBUG:
|
|||||||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
||||||
|
|
||||||
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': BASE_DIR / 'db.sqlite3',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# DATABASES = {
|
# DATABASES = {
|
||||||
# 'default': {
|
# 'default': {
|
||||||
# 'ENGINE': 'django.db.backends.postgresql',
|
# 'ENGINE': 'django.db.backends.sqlite3',
|
||||||
# 'NAME': os.getenv('POSTGRES_DB'),
|
# 'NAME': BASE_DIR / 'db.sqlite3',
|
||||||
# 'USER': os.getenv('POSTGRES_USER'),
|
|
||||||
# 'PASSWORD': os.getenv('POSTGRES_PASSWORD'),
|
|
||||||
# 'HOST': os.getenv('POSTGRES_HOST', 'postgres'),
|
|
||||||
# 'PORT': os.getenv('POSTGRES_PORT', 5432),
|
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
|
'NAME': os.getenv('POSTGRES_DB'),
|
||||||
|
'USER': os.getenv('POSTGRES_USER'),
|
||||||
|
'PASSWORD': os.getenv('POSTGRES_PASSWORD'),
|
||||||
|
'HOST': os.getenv('POSTGRES_HOST', 'postgres'),
|
||||||
|
'PORT': os.getenv('POSTGRES_PORT', 5432),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ENCRYPTION_KEY = os.getenv('ENCRYPTION_KEY')
|
ENCRYPTION_KEY = os.getenv('ENCRYPTION_KEY')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user