Scoop561
Scoop561

Reputation: 73

How to start postgresql server in Heroku?

I'm trying to deploy my app on Heroku but I keep getting the same error I get locally when trying to start the server before starting the database:

psycopg2.OperationalError: could not connect to server: Connection refused
    Is the server running on host "127.0.0.1" and accepting
    TCP/IP connections on port 5432?

Normally, I would just type sudo service postgresql start and that would solve it but it doesn't seem to work on Heroku bash.

Any suggestions?

Upvotes: 1

Views: 158

Answers (1)

Ratnam Yadav
Ratnam Yadav

Reputation: 196

You need to check if PostgreSQL addon is added to your project if not then you will need to add that by running heroku addons:create heroku-postgresql:hobby-dev

For more option follow this link: https://www.heroku.com/postgres

Upvotes: 1

Related Questions