########### DataBases ########### PostgreSQL ************* Postgres Shell ============================ In Ubuntu use sudo -u :: sudo -u postgres psql # or \list will list all the databases, their owner and access privileges postgres=# \l Create and Delete a PostgreSql DB ================================== Use terminal to go to django directory where DB should be located. Create a user if there is not one already created. Create DB. :: postgres=# CREATE USER ; postgres=# ALTER ROLE WITH PASSWORD; # change userpassword postgres=# CREATE DATABASE OWNER ; # 'IF EXISTS' prevent an error from removing database postgres=# DROP DATABASE [IF EXiSTS] ; # If active connections postgres=# SELECT * FROM pg_stat_activity WHERE datname = ''; # returns pif postgres=# SELECT pg_terminate_backend (pid) postgres=# FROM pg_stat_activity postgres=# WHERE pg.stat_activity.datname = '' postgres=# DROP DATABASE ; `Drop postgresdb `_ Update Settings in Django =========================== Find /settings.py file. Go down to the DATABASES section and you should see the following. :: DATABASES = { 'default': { 'ENGINE" 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } Replace with this- :: DATABASES = { 'default': { 'ENGINE" 'django.db.backends.postgresql', 'NAME': '', 'USER': '' 'PASSWORD': ' (venv) #:python manage.py migrate ER Diagrams and Tools ********************** My requirements: * free * reverse engineer from a database What I found 8/21/20 #. `dbdiagram.io `_ web interface #. `pgModeler `_ simple, not free #. `DBeaver `_ complex Install DBeaver ================= :: $ sudo snap install dbeaver-ce Installed DBeaver and created ER diagram. Diagram did not default to standard ER graphic notation. Also would be nicer if I could tell 1-many and many-many relationships on Table Columns. Still everything seems to work ok.