How deploy Flask application on Webfaction?

前端 未结 2 1275
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 06:38

Anybody know how to deploy a simple Flask application on Webfaction? I know Webfaction support mod_wsgi and I read the guide on the Flask site but still I can\'t make my app wor

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 06:52

    You need to set up a "Custom app (listening on port)" application. Make a note of the port that is assigned. Then in your Flask code, you need to put hardcode the port:

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

    Where you substitute XXXXXXX with the port that is randomly assigned to your custom app.

    Hope that helps.

    EDIT:

    Please use Raben's Answer, this way should not to be used in Production.

提交回复
热议问题