无法让Hello World在Heroku上工作

时间:2016-08-18 17:19:37

标签: python python-2.7 heroku

我有我的基本程序

    def test():
        print("Hello World")
    test()

以及Procfile。

    web: python test.py

当我在命令行中使用一次性dyno时,我得到了我期望的结果。但是,当我在Heroku仪表板中打开应用程序时,每次都会出现H10错误。是什么给了什么?

编辑:记录

    2016-08-18T17:34:25.925592+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hwt1.herokuapp.com request_id=a0cabc52-0f80-4094-a420-06147b8c860c fwd="199.133.80.68" dyno= connect= service= status=503 bytes=
    2016-08-18T17:34:26.646976+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hwt1.herokuapp.com request_id=27121a16-ad6b-489f-8ffc-1d3b5e21d225 fwd="199.133.80.68" dyno= connect= service= status=503 bytes=

1 个答案:

答案 0 :(得分:1)

Heroku是一个网络托管服务;您的代码需要启动绑定到端口80的Web服务器。只运行立即终止的脚本不会这样做。