Can't connect to postgresql database on Django project

Hello, I am working with a group of team and I am trying to connect my django project to our postgresql database. However, when I try to make migrations, it gives me password authentication failure.

In the settings.py:
DATABASES = {
‘default’: {
“ENGINE”: “django.db.backends.postgresql”,
“NAME”: getenv(“DB_NAME”),
“USER”: getenv(“DB_USER”),
“PASSWORD”: getenv(“DB_PASSWORD”),
“HOST”: getenv(“DB_HOST”),
“PORT”: getenv(“DB_PORT”),
},
}
In the .env file:
DB_NAME = ‘postgres’
DB_USER = ‘’
DB_PASSWORD = ‘’
DB_HOST = ‘’
DB_PORT = ‘5432’

The input in the .env file is correct because one of my collegue has successfully logged in with this input.
When I tried to ‘python manage.py migrate’, it returns an error
'django.db.utils.OperationalError: connection failed: FATAL: password authentication failed for user “postgres” ’
I am able to connect to the database using pgadmin4.

Any help will be appreciated, and if more information is required, I will provide it as soon as possible.

Logging in how, precisely?

If no DB_USER is supplied, psql will attempt to connect using the current user. If no host is specified, it will try connecting to localhost, using the unix domain socket for the connection. The security mechanics for that is different than when trying to connect through a TCP port.

See the PostgreSQL docs at PostgreSQL: Documentation: 16: Chapter 21. Client Authentication to gain an understanding of how PostgreSQL handles authentication.

(No, it’s not trivial.
Yes, there is a lot to read.
Yes, if you’re going to manage a PostgreSQL server, you do need to understand this.)

Okay, thank you for your reply, I will read the document first