Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillSams/e7d628bdce62fc9a07c2 to your computer and use it in GitHub Desktop.
Save WillSams/e7d628bdce62fc9a07c2 to your computer and use it in GitHub Desktop.
Example Bottle.py App Running on Gandi.Net Simple Hosting Last
#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