简体   繁体   中英

PostgreSQL & Heroku - cannot connect to the database

I'm trying to add a column to a table via my Django app with South but keep getting the following error upon running the python manage.py migrate <app name> command:

conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: could not translate host name "ec2-107-21-99-105.comp
ute-1.amazonaws.com" to address: Temporary failure in name resolution

Does anybody have an idea why this is happening? I'm a newbie to both South AND the PostgreSQL database management system (which Heroku uses), so I am more than a bit confused.

Make sure you have defined your default database in settings.py like this:

DATABASES = {
    'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM