django.db.utils.OperationalError: fe_sendauth: no password supplied django.db.utils.OperationalError: fe_sendauth: no password supplied git git

django.db.utils.OperationalError: fe_sendauth: no password supplied


If you want to use a local password less connection then you need to remove the values "HOST", "PORT" and "PASSWORD".

With this configuration your connector will try to connect using a unix domain socket which is the only allowed password less connection allowed by default in Postgres


I can think of two possible solutions to this problem.

First, if there is no password for the database, remove the PASSWORD key. E.g.:

DATABASES = {    'default': {        'ENGINE': 'django.db.backends.postgresql_psycopg2',        'NAME': 'project_name',        'USER': 'admin',        'HOST': 'localhost',        'PORT': '5432',    }}

Second, if there is a password for the database, provide it in the PASSWORD key:

DATABASES = {    'default': {        'ENGINE': 'django.db.backends.postgresql_psycopg2',        'NAME': 'project_name',        'USER': 'admin',        'PASSWORD': '<YOUR PASSWORD HERE...>',        'HOST': 'localhost',        'PORT': '5432',    }}


Maybe a stupid thing. But for me the problem was that postgres wasn't actually running. So always check whether it's running.

In Linux:

sudo service postgresql status