【发布时间】:2017-01-31 23:41:41
【问题描述】:
我正在使用带有 Django 的 Postgresql,但是当我尝试在 PgAdmin 4 中创建 INSERTO INTO 时遇到问题,总是显示此消息:
Not connected to the server or the connection to the server has been closed.
但是在其他数据库中我可以插入,我不明白为什么在 Djando 创建的数据库中我无法进行查询,我重新安装了 postgresql 但它不起作用。
【问题讨论】:
-
postgresql 是否在日志中说明了什么?
-
可能是您连接到 PgAdmin 的凭据与 Django setting.py 用于数据库的凭据不同。
-
我检查了日志,发现错误是我做了一个错误的查询。
标签: django postgresql django-models