In one folder I have 3 files: base.py, Dockerfile and docker-compose.yml.
base.py:
import psycopg2 conn = psycopg2.connect(\"dbname=\'b
if you add this to your db container in your docker-compose.yml it should resolve the issue
environment: - "POSTGRES_HOST_AUTH_METHOD=trust"