Closed yawtalkstechs closed 2 years ago
@yawtalkstechs, can you verify that the database is running? Check the service running on port 5432
with the command:
lsof -i :5432
I enter the command but nothing was shown on the terminal. I add sudo to the command like this:
This is was shown at the terminal
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME postgres 1080 postgres 3u IPv6 22144 0t0 TCP localhost:postgresql (LISTEN) postgres 1080 postgres 4u IPv4 22145 0t0 TCP localhost:postgresql (LISTEN)
In the settings.py, I added HOST and PORT to databases. To make it look like this:
DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", "NAME": "blog", "USER": "blog", "PASSWORD": " ", "HOST": "localhost", "PORT": 5432 } }
When I try to migrate data after setting up postgresql and running this command:
python manage.py migrate
I run into this error: django.db.utils.OperationalError: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "blog"