Deploying python website on Heroku, not working -
i have deployed python website on heroku, when visit page, see generic heroku "application error" message. when go terminal , check heroku logs, see this:
2013-09-04t04:33:04.130527+00:00 heroku[web.1]: starting process 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 bind $port within 60 seconds of launch 2013-09-04t04:34:06.937868+00:00 heroku[web.1]: stopping process sigkill 2013-09-04t04:34:08.199958+00:00 heroku[web.1]: state changed starting crashed 2013-09-04t04:34:08.158024+00:00 heroku[web.1]: process exited 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=
i'm not sure of means. when run foreman start following message, i'm not sure if related:
21:43:00 web.1 | started pid 1694 21:45:28 web.1 | 127.0.0.1:51458 - - [03/sep/2013 21:45:28] "http/1.1 /" - 404 not found
procfile:
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()
web.py assigns port 8080. while heroku assigns different port. reason not binding $port. can try modifying procfile be
web: python bin/app.py ${port}
heroku take care of filling port value.
Comments
Post a Comment