'heroku run bash' 给出 ECONNREFUSED 52.3.44.61:5000

'heroku run bash' gives ECONNREFUSED 52.3.44.61:5000

我正在尝试部署 Django 项目并尝试创建表和超级用户。

(env) D:\CRM>heroku run bash
 »   Warning: heroku update available from 7.53.0 to 7.60.1.
Running bash on ⬢ quiet-waters-22939... done
Error: connect ECONNREFUSED 52.3.44.61:5000

我的 PostgreSQL 设置是:

listen_addresses = '*'      # what IP address(es) to listen on;
                    # comma-separated list of addresses;
                    # defaults to 'localhost'; use '*' for all
                    # (change requires restart)
port = 5432             # (change requires restart)

上面的错误是不是因为postgresql = 5432中的端口号错误是在端口号5000上? 如果是,那么我需要更改端口号还是其他?

其他类似错误:

(env) D:\CRM>heroku pg:psql             
 »   Warning: heroku update available from 7.53.0 to 7.60.1.
--> Connecting to postgresql-clean-14965
psql: error: connection to server at "ec2-54-157-79-121.compute-1.amazonaws.com" (54.157.79.121), port 5432 failed: Connection refused (0x0000274D/10061)
        Is the server running on that host and accepting TCP/IP connections?  
 !    psql exited with code 2
$ heroku run python manage.py migrate
 »   Warning: heroku update available from 7.53.0 to 7.60.1.
Running python manage.py migrate on ⬢ quiet-waters-22939... done
Error: connect ECONNREFUSED 54.156.98.218:5000

我没有发现错误,但我通过使用 Heroku Dashboard 的控制台而不是使用我的终端解决了这个问题。