-
-
Save jxub/bf37043c6cf8f41581d6da33e18a718f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 >app.py <<EOF | |
import os | |
from bottle import route, run, template | |
index_html = '''My first web app! By <strong>{{ author }}</strong>.''' | |
@route('/') | |
def index(): | |
return template(index_html, author='Real Python') | |
@route('/name/<name>') | |
def name(name): | |
return template(index_html, author=name) | |
if __name__ == '__main__': | |
port = int(os.environ.get('PORT', 8080)) | |
run(host='0.0.0.0', port=port, debug=True) | |
EOF | |
chmod a+x app.py | |
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