Это старая версия документа!
host all all 0.0.0.0/0 md5 host all all ::0/0 md5
listen_addresses = '*'
systemctl restart postgresql
apt install libpq-dev python3-dev pip install psycopg2