正在将Django应用程序切换回PostgreSQL,未找到任何关系
我将数据库引擎切换到PostGIS,现在我将切换回PostgreSQL(这样我可以继续免费使用Heroku)。我将settings.py文件更改回:正在将Django应用程序切换回PostgreSQL,未找到任何关系,django,postgresql,Django,Postgresql,我将数据库引擎切换到PostGIS,现在我将切换回PostgreSQL(这样我可以继续免费使用Heroku)。我将settings.py文件更改回: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'chishenma', 'HOST': 'localhost', } } 并注释掉已安装的应用程序,因此现在
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'chishenma',
'HOST': 'localhost',
}
}
并注释掉已安装的应用程序,因此现在显示:
# 'django.contrib.gis',
首先,我确保Postgres.app正在运行。然后我删除了我的迁移,运行了python manage.py syncdb,并再次执行了南方迁移,所有这些都没有错误。当我进入psql shell并键入\l时,我可以在列表中看到我的数据库“chishenma”:
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------------------+-----------------+----------+-------------+-------------+----------------------
chishenma | michelleglauser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
但是,当我键入\d时,我得到“未找到任何关系”。我试图重新创建数据库,但得到“错误:数据库chishenma已存在。”
我查看并堆栈溢出线程,确定我的访问权限(我有“=UC/postgres”部分)和搜索路径是正确的。我得到:
List of schemas
Name | Owner | Access privileges | Description
--------+-----------------+------------------------------------+------------------------
public | michelleglauser | michelleglauser=UC/michelleglauser+| standard public schema
| | =UC/michelleglauser
以及:
我错过了什么?如何使关系可查找?我能找到的唯一解决方案是从一个新的数据库重新开始。
List of roles
Role name | Attributes | Member of
-----------------+------------------------------------------------+-----------
michelleglauser | Superuser, Create role, Create DB, Replication | {}