Skip to content

Commit

Permalink
config db in django
Browse files Browse the repository at this point in the history
  • Loading branch information
ytliuSVN committed Oct 29, 2024
1 parent 4ef3928 commit c5ed15d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand Down Expand Up @@ -75,8 +76,11 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'ENGINE': 'django.db.backends.postgresql',
'HOST': os.environ.get('DB_HOST'),
'NAME': os.environ.get('DB_NAME'),
'USER': os.environ.get('DB_USER'),
'PASSWORD': os.environ.get('DB_PASS'),
}
}

Expand Down

0 comments on commit c5ed15d

Please sign in to comment.