Heroku App crashes immediately with R10 and H10 errors

前端 未结 3 1148
庸人自扰
庸人自扰 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.

    0 讨论(0)
  • 2021-01-13 13:30

    You need to specify $PORT instead of ${PORT} like

    web: python runserver.py $PORT
    
    0 讨论(0)
  • 2021-01-13 13:32

    This link gives a simple example to start Flask app with Heroku

    0 讨论(0)
提交回复
热议问题