My app runs fine locally using foreman run, and when I execute my runserver.py
file using python runserver.py
. When I push it to Heroku, it just cr
I found the answer to this issue...essentially I had to bind a port and specify the host that I am using:
In my runserver.py file I modified it using:
import os
from intro_to_flask import app
port = int(os.environ.get("PORT", 5000))
app.run(debug=True, host='0.0.0.0', port=port)
It's probably not the most elegant way of doing it.but it works.
You need to specify $PORT
instead of ${PORT}
like
web: python runserver.py $PORT
This link gives a simple example to start Flask app with Heroku