Tell me why, after setting the password to the database, does the django project still read data from it? Here is my sequence of actions:

sudo su su postgres psql ALTER USER mydb WITH PASSWORD 'aequieF7yuy0ohGh'; 

In the database settings in the project is:

  DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'mydb', 'USER': 'mydb', # 'PASSWORD': 'aequieF7yuy0ohGh' } } 

    1 answer 1

    To set a password for a user:

     $ sudo -u postgres psql psql=# alter user <username> with encrypted password '<password>'; 

    And now we give the user privileges over the base:

     psql=# grant all privileges on database <dbname> to <username>;