title: Django app is not connecting with remote database
body: <p>I have a Django app running on hosting server. I am using postgres database which is running on different server. <strong>The app is working properly in my local machine</strong> but in hosting server, the app is running but any functionality is not working which is associated with database. For example, user can not authenticated while login even the username and password is correct.
  I am receiving a error saying "could not connect to server: Connection refused Is the server running on host xxx.xxx.xxx.xxx and accepting TCP/IP connections on port 5432?"
  <strong>My settings for database</strong></p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql',
          'NAME': 'DB_NAME',
          'USER': 'USER',
          'PASSWORD': '*****',
          'HOST': 'IP_ADDRESS',
          'PORT': 'PORT',
      }
  }
  </code></pre>
  
  <p><strong>N:B I have given permission to the postgres database. I can access the db from local machine</strong>
  <hr>
  <strong>Django version 2.2.5</strong></p>