![](/img/trans.png)
[英]How to connect already existing PostgreSQL database with Heroku?
[英]PostgreSQL & Heroku - cannot connect to the database
我正在尝试通过使用South的Django应用程序向表中添加一列,但是在运行python manage.py migrate <app name>
命令时python manage.py migrate <app name>
出现以下错误:
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
有人知道为什么会这样吗? 我既是South还是PostgreSQL数据库管理系统(Heroku使用)的新手,所以我很困惑。
确保已在settings.py
定义了默认数据库,如下所示:
DATABASES = {
'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.