I'm trying to migrate my postgres database to Heroku for a django application. In my settings.py file, I have the following, as dictated by the Heroku tutorial:
import dj_database_url
DATABASES = {'default': dj_database_url.config()}
However, when I run heroku run python manage.py syncdb
I get the following error:
django.db.utils.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?
What am I missing? Thanks in advance!
DATABASES['default'] = dj_database_url.config()
. You've completely replaced theDATABASES
dictionary; they've simply added a new key. That might not be the issue, but it's worth checking. Also, make sure you'vegit commit
ted andgit push
ed your latest code to Heroku. – Alex P Jul 22 '14 at 9:38