Skip to content
Advertisement

authentication failed when I use postgresql with django

My environment

OS: AWS linux
python 3.7
psql (PostgreSQL) 13.3

JavaScript

I am trying to use PostgreSQL with Django.

I changed setting.py like below:

JavaScript

I created a password for PostgreSQL and I successfully logged in as this user.

JavaScript

However, when I tried to execute this:

JavaScript

I got this error:

JavaScript

pg_hba.conf looked like this first:

JavaScript

I changed like this:

JavaScript

However, either way does not work and still same error.

I am not sure what the problem is and would like to know how I can fix this.

Advertisement

Answer

I set the password for the user by ‘ALTER …. WITH ENCRYPTED PASSWORD’ ? And then the problem was solved!

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement