Skip to content

Instantly share code, notes, and snippets.

@dusual
Forked from defnull/gist:1224387
Last active December 1, 2021 19:08
Show Gist options
  • Save dusual/9838932 to your computer and use it in GitHub Desktop.
Save dusual/9838932 to your computer and use it in GitHub Desktop.
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
try:
import gevent.monkey
gevent.monkey.patch_all()
except:
pass
import bottle
import os
@bottle.route('/')
def index():
return "Hello World"
bottle.run(server='gevent', host='0.0.0.0', 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
@jam182
Copy link

jam182 commented Sep 3, 2015

this does not work for me without a shebang line: #!/usr/bin/env python

@ifosch
Copy link

ifosch commented Feb 2, 2017

I also had to specify either web: ./app.py and the shebang @jam182 mentions, or web: python app.py.

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