feat: add Django project settings with database routing, JWT, and logging configuration
Some checks failed
Deploy Beta (NATIVE) / deploy (push) Failing after 27s
Some checks failed
Deploy Beta (NATIVE) / deploy (push) Failing after 27s
This commit is contained in:
parent
2f1850f9a8
commit
ae8632c3f4
1 changed files with 25 additions and 24 deletions
|
|
@ -79,39 +79,40 @@ WSGI_APPLICATION = 'customerwebsitebackend.wsgi.application'
|
|||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/6.1/ref/settings/#databases
|
||||
import os
|
||||
|
||||
db_host = os.environ.get('DB_HOST', '16.113.106.152')
|
||||
db_port = int(os.environ.get('DB_PORT', '5432'))
|
||||
db_user = os.environ.get('DB_USER', 'vignesh')
|
||||
db_pass = os.environ.get('DB_PASSWORD', 'vignesh_secret_pass_2026')
|
||||
|
||||
db_credentials = {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'USER': db_user,
|
||||
'PASSWORD': db_pass,
|
||||
'HOST': db_host,
|
||||
'PORT': str(db_port),
|
||||
}
|
||||
|
||||
env_name = os.environ.get('ENVIRONMENT', 'beta')
|
||||
db_suffix = f'_{env_name}'
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'customerwebsite',
|
||||
'USER': 'vignesh',
|
||||
'PASSWORD': 'vtechnosoft@123A',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '5432',
|
||||
'NAME': f'customerprofile{db_suffix}',
|
||||
**db_credentials
|
||||
},
|
||||
'productprofile': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'productprofile',
|
||||
'USER': 'vignesh',
|
||||
'PASSWORD': 'vtechnosoft@123A',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '5432',
|
||||
'NAME': f'productprofile{db_suffix}',
|
||||
**db_credentials
|
||||
},
|
||||
'customerprofile': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'customerprofile',
|
||||
'USER': 'vignesh',
|
||||
'PASSWORD': 'vtechnosoft@123A',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '5432',
|
||||
'NAME': f'customerprofile{db_suffix}',
|
||||
**db_credentials
|
||||
},
|
||||
'sellerprofile': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'sellerprofile',
|
||||
'USER': 'vignesh',
|
||||
'PASSWORD': 'vtechnosoft@123A',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '5432',
|
||||
'NAME': f'sellerprofile{db_suffix}',
|
||||
**db_credentials
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue