PostgreSQL

Installation

yum install postgresql-server postgresql-contrib
postgresql-setup initdb
systemctl start postgresql
systemctl enable postgresql
# change password and set up access
passwd postgres
su - postgres
psql postgres
# list users and setup postgres user password
\du
\password postgres
# create a database and logout
CREATE DATABASE portfoliodb;
\q

Django Setup

pip install psycopg2
pip install psycopg2-binary
# /var/lib/pgsql/data/pg_hba.conf:
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
#host    all             all             127.0.0.1/32            ident
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
#host    all             all             ::1/128                 ident
host    all             all             ::1/128                 md5