【问题标题】:Database connection Error while hosting site on heroku在 Heroku 上托管网站时出现数据库连接错误
【发布时间】:2020-07-21 19:29:52
【问题描述】:

所以我试图在 heroku 上托管我的第一个 Django 应用程序。 帮助组建了一些 Youtube 频道。我使用 postgresql 作为我的数据库。现在,当我尝试在 heroku 上托管我的应用程序时,出现了以下错误:

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?```
**This is the error showing**

【问题讨论】:

  • 您的数据库托管在哪里?
  • 您使用的是 Mac 吗?
  • 我正在使用 Windows。

标签: django python-3.x github heroku


【解决方案1】:

run postgres -D /usr/local/var/postgres 这样的结果应该是:

    FATAL:  lock file "postmaster.pid" already exists
     HINT:   Is another postmaster (PID 379) running in data directory 

"/usr/local/var/postgres"?

然后输入kill -9 PID in HINT

让我知道这是否适合你?

【讨论】:

  • 我是否在命令提示符下运行代码?我是 Django 的新手。无论如何都不好意思问这样的问题。
  • 没关系。在终端中运行它
猜你喜欢
  • 1970-01-01
  • 2016-02-01
  • 1970-01-01
  • 2020-12-21
  • 2016-10-26
  • 2018-05-31
  • 2013-07-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多