uploading web.py app on Heroku -
just started on using web.py , heroku, so...
i have simple app want upload heroku , have followed instruction http://joshuaoiknine.com/post/47196802362/publishing-for-the-web-py-python-framework-to-heroku
this procfile:
web: python code.py $path
but after uploaded heroku, gives me application error. heroku log shows me this:
2013-08-08t03:27:44.956675+00:00 heroku[web.1]: starting process command `python code.py /usr/local/bin:/usr/bin:/bin` 2013-08-08t03:27:45.673358+00:00 app[web.1]: traceback (most recent call last): 2013-08-08t03:27:45.673358+00:00 app[web.1]: file "code.py", line 52, in <module> 2013-08-08t03:27:45.673358+00:00 app[web.1]: app.run() 2013-08-08t03:27:45.673358+00:00 app[web.1]: file "/app/.heroku/python/lib/python2.7/site-packages/web/application.py", line 313, in run 2013-08-08t03:27:45.673358+00:00 app[web.1]: return wsgi.runwsgi(self.wsgifunc(*middleware)) 2013-08-08t03:27:45.673358+00:00 app[web.1]: file "/app/.heroku/python/lib/python2.7/site-packages/web/wsgi.py", line 54, in runwsgi 2013-08-08t03:27:45.673358+00:00 app[web.1]: return httpserver.runsimple(func, validip(listget(sys.argv, 1, ''))) 2013-08-08t03:27:45.673358+00:00 app[web.1]: file "/app/.heroku/python/lib/python2.7/site-packages/web/net.py", line 76, in validip 2013-08-08t03:27:45.673358+00:00 app[web.1]: port = int(port) 2013-08-08t03:27:45.673552+00:00 app[web.1]: valueerror: invalid literal int() base 10: '/usr/local/bin:/usr/bin:/bin' 2013-08-08t03:27:46.866238+00:00 heroku[web.1]: process exited status 1 2013-08-08t03:27:46.881655+00:00 heroku[web.1]: state changed starting crashed
however, when tried second method, receive error:
traceback (most recent call last): file "code.py", line 55, in <module> app.run(host='0.0.0.0', port=port) typeerror: run() got unexpected keyword argument 'host'
any ideas how app onto heroku , running?
code.py
expects integer argument first, not $path. port expecting, instead of $path
in procfile
pass $port
.
even better: change code use env["port"]
, if that's not defined (as might case in local dev env) default (say, 8000 or 8080 dev env).
on heroku, port server needs listen on not fixed -- changes every restart of every dyno. heroku set environment variable port
let know port listen on.
Comments
Post a Comment