我已经在heroku 上部署了我的python 网站,但是当我访问该页面时,我看到了一条通用的heroku“应用程序错误”消息。然后当我进入终端并检查heroku日志时,我看到了:
2013-09-04T04:33:04.130527+00:00 heroku[web.1]: Starting process with command `python bin/app.py`
2013-09-04T04:33:06.871127+00:00 app[web.1]: http://0.0.0.0:8080/
2013-09-04T04:34:06.937646+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2013-09-04T04:34:06.937868+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-09-04T04:34:08.199958+00:00 heroku[web.1]: State changed from starting to crashed
2013-09-04T04:34:08.158024+00:00 heroku[web.1]: Process exited with status 137
2013-09-04T04:34:09.013423+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=arcane-lake-2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes=
2013-09-04T04:34:11.107423+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=arcane-lake-2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes=
2013-09-04T04:35:54.768913+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=arcane-lake-2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes=
2013-09-04T04:37:35.374279+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=arcane-lake-2908.herokuapp.com fwd="71.20.1.73" dyno= connect= service= status=503 bytes=
我不确定这意味着什么。此外,当我运行 foreman start 时,我收到以下消息,我不确定这是否相关:
21:43:00 web.1 | started with pid 1694
21:45:28 web.1 | 127.0.0.1:51458 - - [03/Sep/2013 21:45:28] "HTTP/1.1 GET /" - 404 Not Found
过程文件:
web: python bin/app.py
app.py
:
import web
urls = ( '/hello', 'Index' )
app = web.application(urls, globals())
render = web.template.render('templates/')
class Index(object):
def GET(self):
return render.hello_form()
def POST(self):
form = web.input(name="Nobody", greet="Hello")
greeting = "%s, %s" % (form.greet, form.name)
return render.index(greeting = greeting)
if __name__ == "__main__":
app.run()