Heroku App crashes immediately with R10 and H10 errors

前端 未结 3 1171
庸人自扰
庸人自扰 2021-01-13 12:50

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

3条回答
  •  粉色の甜心
    2021-01-13 13:17

    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.

提交回复
热议问题