Deployment Python/Flask Application Failure in Heroku

Asked

Viewed 26 times

-2

Hello, I’m starting my journey with Python and Flask, I developed an application and I’m currently trying to upload it to Heroku, but I have the following error message in the panel log:

inserir a descrição da imagem aqui

I researched here and I even found some answers but very superficial, below follows my code and I would like a help to understand where I have to change, I will detail here the files of Procfile also, I would be grateful if someone can help.

Procfile

web: python app.py 

app.py file end

if __name__ == "__main__":
app.run(host = '0.0.0.0')

1 answer

0

Personnel managed to solve the case, I only changed the main file as follows::

if __name__ == "__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port)

Application running 100%.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.