I have Fedora-31 Template. And a VM based on this template.
I installed PSQL in Template:
$ sudo dnf install postgresql postgresql-server
If I try to connect to PSQL from my VM using Python, I get the following error:
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host “127.0.0.1” and accepting
TCP/IP connections on port 5432?
If I type “$ postgres --version” in my VM, I get “postgres (PostgreSQL) 11.8”, so I think it is installed properly.
How to debug it?