I'm getting the following error when I try to connect to my postgresql server locally from the same ec2 instance as the postgresql server:
django.db.utils.OperationalError: FATAL: Ident authentication failed for user "django"
I checked my pg_hba.conf to make sure it allowed local connections:
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
My settings.py has the following settings:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'famtest',
'USER': 'django',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '5432',
}
}
These settings work when I run the project on my machine(I change 'localhost' to the ip address) but not when I try to run the project from the same ec2 instance.
pg_ctl reload) after changing pg_hba.conf?