Django setting : psycopg2.OperationalError: FATAL: Peer authentication failed for user “indivo”

I have similar problem and solved it with this answer by adding localhost to the database HOST settings in settings.py, so your database settings should look like this:

DATABASES = {
    'default':{
        'ENGINE':'django.db.backends.postgresql_psycopg2', # '.postgresql_psycopg2', '.mysql', or '.oracle'
        'NAME':'indivo', # Required to be non-empty string
        'USER':'indivo', # Required to be non-empty string
        'PASSWORD':'ritvik',
        'HOST':'localhost', # <- Changed from empty string to localhost
        'PORT':'', # Set to empty string for default.
        },
}

Leave a Comment