public
Last active

Deploy a Bottle app on Heroku

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
mkdir heroku
cd heroku/
virtualenv --no-site-packages env
source env/bin/activate
pip install bottle gevent
pip freeze > requirements.txt
 
cat >app.py <<EOF
import bottle
import os
 
@bottle.route('/')
def index():
return "Hello World"
 
bottle.run(server='gevent', port=os.environ.get('PORT', 5000))
EOF
 
chmod a+x app.py
 
echo 'web: app.py' > Procfile
echo 'env/' > .gitignore
 
git init
git add .
git commit -m "Initial commit"
 
heroku create
git push heroku master

Apparently for gevent you need to use gevent.monkey.patch_all(). Also may be there was something I did wrong but I think you need to add host . Because as I could see heroku ran just a local server with this.
I have added some revisions here
https://gist.github.com/dusual/9838932

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.