summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.py6
-rw-r--r--reqs.txt1
2 files changed, 6 insertions, 1 deletions
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