Connection refused with postgresql using psycopg2
<blockquote>
  <p>psycopg2.OperationalError: could not connect to server: Connection refused</p>
</blockquote>

<p>Is the server running on host "45.32.1XX.2XX" and accepting TCP/IP connections on port 5432?</p>

<p>Here,I've open my sockets.</p>

<pre><code>tcp        0      0 127.0.0.1:5432          0.0.0.0:*  LISTEN      11516/postgres                
tcp6       0      0 ::1:5432                :::*       LISTEN      11516/postgres
</code></pre>

<p>I googled that I should modify this <code>pg_hba.conf</code>，but in my <code>postgresql</code>root files, I didn't find this file at all.</p>

<p>Also I've succeed in connecting my another server.</p>

<p>Thanks.</p>

<p>Here,I've modified the <code>pg_hba.conf</code>,updated this<code>host all all 218.3.A.B trust</code> and reloaded.But it didn't work either.</p>