title: PostrgeSQL + Django on Debian 8
body: <p>Good day, I've got a Debian 8 server where I'm running a few of django test apps and I want to connect them to PostgreSQL instead of SQLite. Can you please help me with this problem ? </p>
  
  <p>this is settings.py of my project (DATABASES block)</p>
  
  <pre><code>DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.postgresql_psycopg2',
      'NAME': 'testProject',
      'USER': 'admin',
      'PASSWORD': 'adminPassword',
      'HOST': 'localhost',
      'PORT': '',
   }
  }
  </code></pre>
  
  <p>I think I've installed it successfully by </p>
  
  <p><code>sudo apt-get install python-pip python-dev libpq-dev postgresql postgresql-contrib</code></p>
  
  <p>and  </p>
  
  <pre><code>CREATE DATABASE testProject;
  CREATE USER admin WITH PASSWORD 'adminPassword';
  GRANT ALL PRIVILEGES ON DATABASE testProject TO admin;
  </code></pre>
  
  <p>And when I try to access page, It shows "server refused connection" or something like that.</p>
  
  <p>Thank you guys and have a nice day !</p>