I have postgres installed in my ubuntu18.04, and running on port 5432.
I have django application and its in docker.
my database connection in settings.py file is like below.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'dbname',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': 5432,
}
}
when i run command sudo docker-compose run it gives me below error.

