zuri-training / My_debtors_Team35

This stuDebt platform is centred on helping schools prevent debtors from registering in another school despite pending debts in the previous school.
Apache License 2.0
6 stars 5 forks source link

Use python-decouple to configure DB_Password #37

Open ebereanuebunwa opened 2 years ago

ebereanuebunwa commented 2 years ago

Create a new postgres database named studebt_db1 on your local machine
Set up virtual environment
Install pip dependencies from requirements.txt
After cloning this repo, create a .env file inside the Backend folder.

Backend/.env

Store the password for your postgres database as an environment variable inside the .env file and save.
Backend/.env

DB_PASSWORD="******"

I will use python-decouple to configure DB_PASSWORD

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'studebt_db1',
        'USER': 'postgres',
        'PASSWORD': config('DB_PASSWORD'),
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

Then make migrations and migrate

py manage.py makemigrations
py manage.py migrate