0

I want to preface that everything works on my other computer but with the new macbook I got, I am trying to determine the cause of the issue.

The issue is when attempting to run python manage.py runserver with my Django project with PostgreSQL.

I have made sure to install all my node modules and dependencies, I have re-installed PostgreSQL using homebrew and have started my postgres.

waiting for server to start....2020-03-11 13:49:40.157 EDT [88879] LOG:  starting PostgreSQL 12.2 on x86_64-apple-darwin18.7.0, compiled by Apple clang version 11.0.0 (clang-1100.0.33.17), 64-bit
2020-03-11 13:49:40.159 EDT [88879] LOG:  listening on IPv6 address "::1", port 5432
2020-03-11 13:49:40.159 EDT [88879] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2020-03-11 13:49:40.160 EDT [88879] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-03-11 13:49:40.168 EDT [88880] LOG:  database system was shut down at 2020-03-11 13:45:10 EDT
2020-03-11 13:49:40.171 EDT [88879] LOG:  database system is ready to accept connections
 done
server started

EDIT Removed prior error from this question; replaced with new one ** The previous error was to do with ports and postgres settings but now I am getting a fatal error stating that postgres does not exist. Recommendations?

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/Users/neme/.local/share/virtualenvs/project-azure-87EjIYum/lib/python3.7/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection
    self.connect()
  File "/Users/neme/.local/share/virtualenvs/project-azure-87EjIYum/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/Users/neme/.local/share/virtualenvs/project-azure-87EjIYum/lib/python3.7/site-packages/django/db/backends/base/base.py", line 197, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/Users/neme/.local/share/virtualenvs/project-azure-87EjIYum/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/Users/neme/.local/share/virtualenvs/project-azure-87EjIYum/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 185, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/Users/neme/.local/share/virtualenvs/project-azure-87EjIYum/lib/python3.7/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "postgres" does not exist

I have tried the solution from PostgreSQL error: Fatal: role "username" does not exist shows postgres as an unknown user.

  • Did you check the ports? It says it's looking for 5433, but your server is serving on 5432 – Conner Stephen McCabe Mar 11 '20 at 18:33
  • I had checked the ports initially, but didn't see any resolution. After a bit of debugging it was a combination of the port and postgresql settings. However, now I'm getting a new error. will update my question. – Aaron Neme Mar 11 '20 at 18:39
  • This is now probably because you don't have a user called 'postgres' presumably? I think maybe you haven't followed the setup guide correctly, and have just copy pasted hoping it would work? StackOverflow is for unique issues that people haven't faced before, you should probably head to a forum for this sort of help :) FYI change this line: https://github.com/aneme1038/project-azure/blob/master/azure/azure/settings.py#L85 To whatever user you created your database with. – Conner Stephen McCabe Mar 12 '20 at 14:58

0 Answers0