Django-Einstellung: psycopg2.OperationalError: FATAL: Peer-Authentifizierung für Benutzer "indivo" fehlgeschlagen

Ich habe ein Problem bei der Django-Projekteinstellung mit POSTGRESQL.

Hier ist meine setting.py Datenbankeinstellung

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':'', # Set to empty string for localhost.
        'PORT':'', # Set to empty string for default.
        },
}

Jetzt im Postgres-Backend ist das, was ich getan habe.

rohit@rohit-desktop:~$ sudo su - postgres
postgres@rohit-desktop:~$ createuser --superuser indivo   # create a super user indivo
postgres@rohit-desktop:~$ psql  # open psql terminal 
psql (9.1.8)
Type "help" for help.

postgres=# \password indivo  # set the password ritvik
Enter new password: 
Enter it again: 
postgres=# \q   #logout 
postgres@rohit-desktop:~$ createdb -U indivo -O indivo indivo  #create db indivo 

Leider erhalte ich beim Versuch, eine Synchronisierung durchzuführen, den Fehler.

psycopg2.OperationalError: FATAL:  Peer authentication failed for user "indivo"

Bitte helfen Sie mir, was ich hier falsch machen könnte.

Antworten auf die Frage(4)

Ihre Antwort auf die Frage