Skip to content

Instantly share code, notes, and snippets.

@defnull
Created September 17, 2011 21:22
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save defnull/1224387 to your computer and use it in GitHub Desktop.
Save defnull/1224387 to your computer and use it in GitHub Desktop.
Deploy a Bottle app on Heroku
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
@dusual
Copy link

dusual commented Mar 28, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment