title: Remote connection issues with psycopg2 and postgresql
body: <p>I'm trying to connect to a postgresql database using the following python code:</p>
  
  <pre><code>try:
      conn = psycopg2.connect("host = '10.47.65.237' dbname = 'testDB' user = 'pi' password = 'raspberry'")
  except:
      print("Unable to connect to testDB at 10.47.65.237. Sending Alert.")
  </code></pre>
  
  <p>This code works with localhost 127.0.0.1 but when I go to a different machine and try to run it with its ip above it won't connect.</p>
  
  <p>Things I've done:
  1. Port 5432 is open
  2. edited postgresql.conf by adding the line "listen_addresses='10.47.65.138'"
  3. edited pg_hba.conf by adding the following configuration "host all all 10.47.65.138 md5"</p>
  
  <p>Any other things I could try or I'm missing?</p>