在Heroku上部署python网站,不起作用

在Heroku上部署python网站,不起作用,python,heroku,Python,Heroku,我已经在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/ 20

我已经在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()

py将端口分配为8080。而Heroku则分配不同的端口。这可能就是它没有绑定到$PORT的原因。 您可以尝试将Procfile修改为

web: python bin/app.py ${PORT}

Heroku将负责填充端口值。

Web.py将端口分配为8080。而Heroku则分配不同的端口。这可能就是它没有绑定到$PORT的原因。 您可以尝试将Procfile修改为

web: python bin/app.py ${PORT}

Heroku将负责填充端口值。

您能在此处粘贴app.py的代码吗?“导入web URL=('/hello',Index')app=web.application(URL,globals())render=web.template.render('templates/')类索引(对象):def GET(self):return render.hello_form()def POST(self):form=web.input(name=“Nobody”,greet=“Hello”)greeting=“%s,%s”%(form.greet,form.name)如果name==“main”:app.run()返回render.index(greeting=greeting)“我在@Rohisorry正确发布代码时遇到问题。我是想问Procfile。关于代码,对于Procfile,您可以将其编辑到主帖子中。您可以将app.py的代码粘贴到此处吗?”导入web URL=('/hello','Index')app=web.application(URL,globals())render=web.template.render('templates/')类索引(对象):def GET(self):返回render.hello_form()def POST(self):form=web.input(name=“Nobody”,greet=“hello”)greeting=“%s,%s%”(form.greet,form.name)如果name=”main“:app.run(),则返回render.index(greeting=greeting)“我在@rohisorry正确发布代码时遇到问题。我想问Procfile。关于代码,对于Procfile,您可以将其编辑到主帖子中。