postgresql을 설치 후 pgAdmin4를 실행한다.
Databases 우클릭 → create → database → General/Database 부분에 DB명 입력 → Save!
# credentials.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'DB명',
'USER': 'USER명',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '5432'
}
}
# settings.py
import credentials
DATABASES = credentials.DATABASES
$ python manage.py makemigrations
$ python manage.py migrate