From faf3ad786b062d422377c26b18f194026b296182 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Wed, 14 Mar 2012 00:01:56 -0700 Subject: this should (not) work --- app.py | 6 +++++- reqs.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 4b544c6..439c6ae 100644 --- a/app.py +++ b/app.py @@ -1,8 +1,9 @@ import os import random +import requests import string -from bottle import post, route, run, static_file +from bottle import post, route, request, run, static_file @route('/') def index(name='home'): @@ -14,7 +15,10 @@ def sig(id='home'): @post('/s') def sig(id='home'): + data = request.POST.output id = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(6)) + url = 'https://pinkyswear:abc123@pinkyswear.cloudant.com/pinkyswear/%s' % id + requests.post(url, data=data) return id run(host='localhost', port=8000) diff --git a/reqs.txt b/reqs.txt index 310dc0b..4359cc8 100644 --- a/reqs.txt +++ b/reqs.txt @@ -1 +1,2 @@ bottle +requests -- cgit v1.3.1