データベースに接続できないという問題が発生し続けます。
psycopg2.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/tmp/.s.PGSQL.5432”?
私はいくつかの読書をしました、そしてそれはほとんどの人がポートが正しいことをチェックすることによって、すなわち彼らのsetup.pyで5432から5433に変更することによって修正する非常に一般的な問題のようです。しかし、これは私の問題ではないようです– / opt / bitnami/postgresqlディレクトリに.s.PGSQL.5432が表示されます。psqlにログインできますが、正しく機能しているようです。デフォルトのデータベース名はpostgresqlだと思いますが、djangostackという名前でも試してみましたが、どちらも機能しませんでした。Djangoのsetting.pyのデータベース情報は次のようになります。
DATABASES = {
'default': {
'ENGINE': 'postgresql_psycopg2', #'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'postgres', # Or path to database file if using sqlite3.
'USER': 'postgres', # Not used with sqlite3.
'PASSWORD': 'bitnami', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '5432', # Set to empty string for default. Not used with sqlite3.
}
/ tmp /ディレクトリを調べましたが、隠されているかどうかにかかわらず、そこには何もありません。あるはずですか?誰かが私が間違っていることを知っていますか?元のサンプルプロジェクトをばかげて上書きしたので、設定が何であるかがわかりません。
どうもありがとう、アレックス