Heroku で postgres を使用して Django をセットアップしましたが、うまく機能します。ただし、ローカルで開発したいので、このプロジェクトのローカル開発には sqlite を使用しても問題ありません。
ローカル設定ファイルを追加し、データベース設定をローカルで sqlite に戻しました。サイトをローカルで読み込むと、次のエラーが表示されます。
OperationalError: 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?
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" (fe80::1) and accepting
TCP/IP connections on port 5432?
これが私のローカルデータベース設定です:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'wagon_sql.sql3', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
}
}
のバージョンか何かのようなステップを忘れているだけだと思いsyncdb
ます..しかし..よくわかりません。これを機能させる方法についてのアイデアはありますか? これをより明確にするために、他にどのような情報を提供できますか?
ありがとう!
編集
私が尋ねているのは、DATABASE
設定を変更した後、サーバーを再起動する以外に実行する必要があるコマンドはありますか?