Last active
April 21, 2016 12:19
-
-
Save WillSams/e7d628bdce62fc9a07c2 to your computer and use it in GitHub Desktop.
Example Bottle.py App Running on Gandi.Net Simple Hosting Last
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
#git pull ssh+git://<login>@git.<datacenter>.gpaas.net/default.git | |
mkdir -p MyWebApp && cd MyWebApp | |
virtualenv venv | |
source venv/bin/activate | |
pip install bottle | |
pip freeze > requirements.txt | |
cat > hello.py <<EOF | |
# -*- coding: utf-8 -*- | |
from bottle import Bottle | |
app = Bottle() | |
@app.route('/hello') | |
def hello(): | |
return "Hello from hello!" | |
@app.route('/') | |
def index(): | |
return "Hello from index!" | |
EOF | |
cat > wsgi.py <<EOF | |
# -*- coding: utf-8 -*- | |
from hello import app as application | |
#for local development, un-comment the next line. If using Apache, you can leave commented | |
# application.run(server='auto') | |
EOF | |
git init | |
git remote add origin ssh+git://<login>@git.<datacenter>.gpaas.net/default.git #if you pulled existing, omit this step | |
cat > .gitignore <<EOF | |
#venv #if we are deploying to remote server, uncomment this line. If to GitHub, do not push virtual environment | |
*.pyc | |
EOF | |
git add . | |
git commit -am "Initial commit." | |
git push origin master | |
ssh <login>@git.<datacenter>.gpaas.net 'deploy default.git' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment