From 365afbe3791c849f957c2b6b4f5433b4229a5598 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Wed, 14 Mar 2012 00:34:37 -0700 Subject: template works, still need to escape --- app.py | 7 ++++--- index.html | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 95d38cf..e8cabe8 100644 --- a/app.py +++ b/app.py @@ -4,17 +4,18 @@ import random import requests import string -from bottle import post, route, request, run, static_file +from bottle import post, route, request, run, static_file, template @route('/') def index(name='home'): - return static_file('index.html', root=os.path.dirname(__file__), mimetype='text/html') + return template('index.html', sig=None) @route('/s/:id') def sig(id='home'): url = 'https://pinkyswear.cloudant.com/pinkyswear/%s' % id r = requests.get(url, auth=('pinkyswear', 'abc123')) - return json.loads(r.content)['s'] + sig = json.loads(r.content)['s'] + return template('index.html', sig=sig) @post('/s') def sig(id='home'): diff --git a/index.html b/index.html index 4d9d8b3..7967466 100755 --- a/index.html +++ b/index.html @@ -29,7 +29,9 @@ -- cgit v1.3.1