Django - PostgreSQL docker - authentication issue [duplicate]

I've been trying to set up my first Django and PostgreSQL project with Docker containers.

I followed this setup and everything went as expected: https://learndjango.com/tutorials/django-docker-and-postgresql-tutorial

Opening my Django admin portal worked without any issues on: http://127.0.0.1:8000/admin/

However I also wanted to connect to my 'db' (via DBeaver or in the terminal). However, I keep getting this error:

FATAL: password authentication failed for user "postgres" FATAL: password authentication failed for user "postgres"

Does anyone have any experience with this issue?

DBeaver connection

docker-compose.yml

settings.py

I first tried to only have my PostgresQL database in docker and keep the Django project outside, locally. However, that was the first time I bumped into the issue of 'password authentication'. I figured it was because I didn't set up both the Django project and my PostgresQL in Docker containers. But unfortunately, adding both in Docker containers did not help.

I also tried to: Change the pg_hba.conf authentication Method to 'host all all all md5' instead of 'host all all all scram-sha-256'. But that didn't do anything either.

Вернуться на верх