title: OperationalError : FATAL: no pg_hba.conf entry for host "127.0.0.1", user "fibzadmin", database "fibz", SSL off
body: <p>I have been struggling with this issue for a few days now. I have read numerous other SO threads and it seems like my django app is having difficulty connecting to the postgres database. I am not sure why that is happening though. I am hoping some of the experts out there can take a look and tell me why this might be happening. I have pasted some of my configuration here.</p>
  
  <p>This is what my settings.py contains</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.contrib.gis.db.backends.postgis',
          'NAME': 'fibz',
          'USER':"fibzadmin",
          "PASSWORD":"fibzadmin",
          "HOST":"localhost",
          "PORT":"5432",
      }
  }
  </code></pre>
  
  <p>This is what my pg_hba.conf and postgresql.conf look like</p>
  
  <pre><code>sudo vim /var/lib/pgsql9/data/pg_hba.conf
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>local   all             all                                     trust
  # IPv4 local connections:
  host    all             power_user      0.0.0.0/0               md5
  # IPv6 local connections:
  host    all             other_user      0.0.0.0/0               md5
  host    all             storageLoader   0.0.0.0/0               md5
  host    all             all             ::1/128                 md5
  </code></pre>
  
  <p>following are the main uncommented lines</p>
  
  <pre><code>listen_addresses = '*'
  port = 5432 
  max_connections = 100 
  </code></pre>
  
  <p>and this is from the psql</p>
  
  <pre><code>(fibzVenv) [admin]$ sudo su - postgres
  Last login: Fri Nov 23 07:13:53 UTC 2018 on pts/3
  -bash-4.2$ psql -U postgres
  psql (9.2.24)
  Type "help" for help.
  
  postgres=# \du
                                List of roles
   Role name  |                   Attributes                   | Member of 
  ------------+------------------------------------------------+-----------
   postgres   | Superuser, Create role, Create DB, Replication | {}
   fibzadmin |                                                | {}
  
  postgres=# \l
                                       List of databases
     Name    |   Owner    | Encoding |   Collate   |    Ctype    |     Access privileges     
  -----------+------------+----------+-------------+-------------+---------------------------
   postgres  | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
   fibz      | fibzadmin  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/fibzadmin           +
             |            |          |             |             | fibzadmin=CTc/fibzadmin
   template0 | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres              +
             |            |          |             |             | postgres=CTc/postgres
   template1 | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres              +
             |            |          |             |             | postgres=CTc/postgres
  (4 rows)
  </code></pre>
  
  <p>Are there any suggestions on what I might be doing wrong or what I should be looking at ? This is happening on amazon linux its on the same instance. </p>