エラー
PostgreSQLに接続できていない。
psycopg2.OperationalError: could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
解決策
設定を修正
settings.pyのDATABASESに「'PORT': '5432',」記載
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'DBの名前', 'USER': 'ユーザー名', 'PASSWORD': 'パスワード', 'HOST': 'localhost', 'PORT': '5432', } }
もしくは
PostgreSQLに接続を行う
$ postgres -D /usr/local/var/postgres