unable to runserver in django 1.10.1 due to database connection
<p>I am using PostGRE sql in my localhost in Django 1.10.1 and have installed all dependencies, psycopg2, postgresql, pgadmin3 and have set the password of postgresql via command line. I've used exactly the same password in settings.py of the django project. Still I am being shown the authentication error. I am using pyvenv virtual environment with python 3.5.2</p>

<p>Please check the error code below:</p>

<pre><code>Traceback (most recent call last):
</code></pre>

<blockquote>
  <p>File
  "/home/jayesh/django/myproject/lib/python3.5/site-packages/django/db/backends/base/base.py",
  line 199, in ensure_connection
      self.connect()   File "/home/jayesh/django/myproject/lib/python3.5/site-packages/django/db/backends/base/base.py",
  line 171, in connect
      self.connection = self.get_new_connection(conn_params)   File "/home/jayesh/django/myproject/lib/python3.5/site-packages/django/db/backends/postgresql/base.py",
  line 176, in get_new_connection
      connection = Database.connect(**conn_params)   File "/home/jayesh/django/myproject/lib/python3.5/site-packages/psycopg2/<strong>init</strong>.py",
  line 164, in connect
      conn = _connect(dsn, connection_factory=connection_factory, async=async) psycopg2.OperationalError: FATAL:  password
  authentication failed for user "postgresql" FATAL:  password
  authentication failed for user "postgresql"</p>
</blockquote>

<p>The settings.py contains the following reg DB:</p>

<pre><code>DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'myproject',
        'USER': 'postgresql',
        'PASSWORD': 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '5432',
    }
}
</code></pre>

<p>Please guide regarding the above issue.</p>

<p>I've already followed the following links:
<a href="http://stackoverflow.com/questions/15805561/django-setting-psycopg2-operationalerror-fatal-peer-authentication-failed-fo">Django setting : psycopg2.OperationalError: FATAL: Peer authentication failed for user &quot;indivo&quot;</a></p>

<p><a href="http://stackoverflow.com/questions/12906351/importerror-no-module-named-psycopg2">ImportError: No module named psycopg2</a></p>

<p><a href="http://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu">How connect Postgres to localhost server using pgAdmin on Ubuntu?</a></p>

<p>Looks like psycopg2 also had its own dependencies that were not properly installed for me.</p>

<p>Also the default username of is not postgresql but its just postgres</p>

<p>Both of the above checks gave me the solution required and django 1.10 server is up and running now.</p>

python django postgresql psycopg2