SSH tunneling from Heroku

Yes, you can. Having now gone down this path: yes, it is possible to set up an SSH tunnel from heroku to an external database. [NOTE: My particular app was written in Ruby on Rails, but the solution given here should work for any language hosted on Heroku.] Statement of the problem I am running … Read more

Deploying Flask with Heroku

In my Flask app hosted on Heroku, I use this code to start the server: if __name__ == ‘__main__’: # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get(‘PORT’, 5000)) app.run(host=”0.0.0.0″, port=port) When developing locally, this will use port 5000, in production Heroku will set the PORT environment variable. (Side note: By … Read more