souravlahoti
souravlahoti

Reputation: 736

Flask Deploy on Heroku - Error R10

I successfully deployed the app and ran the url its shows application error. Checked the Log, it states:

* Running on http://127.0.0.1:5000/
Web process failed to bind to $PORT within 60 seconds of launch

Procfile

web: python run.py ${PORT}

run.py

from app import app
app.run(debug=False)

I also tried with

 from os import environ
 from app import app
 app.run(debug=False, port=environ.get("PORT", 5000), processes=2)

In both the case the error still persist

views.py

 @app.route('/')
 @app.route('/login', methods=["GET","POST"])
 def login():
 ....

Upvotes: 1

Views: 493

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599450

That's really not how you run a Flask application in production. You need an actual server, such as gunicorn, and you point that to your app object:

web: gunicorn app:app

This is all fully explained in the Heroku tutorial.

Upvotes: 2

Related Questions