chartManD commited on
Commit
f449349
·
1 Parent(s): 0dcddfc

Config database

Browse files
Files changed (1) hide show
  1. app/mysite/settings.py +7 -2
app/mysite/settings.py CHANGED
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
11
  """
12
 
13
  from pathlib import Path
 
14
 
15
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
16
  BASE_DIR = Path(__file__).resolve().parent.parent
@@ -75,8 +76,12 @@ WSGI_APPLICATION = 'mysite.wsgi.application'
75
 
76
  DATABASES = {
77
  'default': {
78
- 'ENGINE': 'django.db.backends.sqlite3',
79
- 'NAME': BASE_DIR / 'db.sqlite3',
 
 
 
 
80
  }
81
  }
82
 
 
11
  """
12
 
13
  from pathlib import Path
14
+ import os
15
 
16
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
17
  BASE_DIR = Path(__file__).resolve().parent.parent
 
76
 
77
  DATABASES = {
78
  'default': {
79
+ 'ENGINE': 'django.db.backends.mysql',
80
+ 'NAME': os.getenv('DB_DATABASE_NAME'),
81
+ 'USER': os.getenv('DB_USER'),
82
+ 'HOST': os.getenv('DB_HOST'),
83
+ 'PASSWORD': os.getenv('DB_PASSWORD'),
84
+ 'PORT': os.getenv('DB_PORT')
85
  }
86
  }
87