python - Unable to connect to local Postgresql server using django -
i'm getting following error when try connect postgresql server locally same ec2 instance postgresql server:
django.db.utils.operationalerror: fatal: ident authentication failed user "django"
i checked pg_hba.conf make sure allowed local connections:
# "local" unix domain socket connections local trust # ipv4 local connections: host 127.0.0.1/32 trust
my settings.py has following settings:
databases = { 'default': { 'engine': 'django.db.backends.postgresql_psycopg2', 'name': 'famtest', 'user': 'django', 'password': '', 'host': 'localhost', 'port': '5432', } }
these settings work when run project on machine(i change 'localhost' ip address) not when try run project same ec2 instance.
realised running django server on 0.0.0.0 instead of default (for reason server doesn't work 127.0.0.1).
i added 0.0.0.0 pg_hba.conf connection list , it's working fine now.
Comments
Post a Comment