Skip to content Skip to sidebar Skip to footer

Heroku Django: Operational Error Connection Refused

I get the following error when I try to deploy my latest version to Heroku: could not connect to server: Connection refused Is the server running on host 'localhost' and accept

Solution 1:

You need to get the database connection information from the DATABASE_URL environment variable. Per @kwarunek, Use the library dj-database-url library (https://github.com/kennethreitz/dj-database-url) and follow the directions here: https://devcenter.heroku.com/articles/getting-started-with-python#provision-a-database.

Heroku follows the 12-factor (http://12factor.net) design principles, and treats the database as an 'attached service' whose configuration is provided via the environment.

Post a Comment for "Heroku Django: Operational Error Connection Refused"