Skip to content

Instantly share code, notes, and snippets.

Last active Mar 26, 2022
What would you like to do?
mkdir bottle
cd bottle
pip install virtualenv==12.0.7
virtualenv venv
source venv/bin/activate
pip install bottle==0.12.8
pip freeze > requirements.txt
git init
git add .
git commit -m "initial commit"
cat > <<EOF
import os
from bottle import route, run, template
index_html = '''My first web app! By <strong>{{ author }}</strong>.'''
def index():
return template(index_html, author='Real Python')
def name(name):
return template(index_html, author=name)
if __name__ == '__main__':
port = int(os.environ.get('PORT', 8080))
run(host='', port=port, debug=True)
chmod a+x
git init
git add .
git commit -m "Updated"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment