diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2012-03-14 00:01:56 -0700 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2012-03-14 00:02:05 -0700 |
| commit | faf3ad786b062d422377c26b18f194026b296182 (patch) | |
| tree | 86f688c83c46b211d79f5722269dd0ee7829d799 | |
| parent | 97b9d3a453dd34eefe0527bf034053e75fe4a38c (diff) | |
this should (not) work
| -rw-r--r-- | app.py | 6 | ||||
| -rw-r--r-- | reqs.txt | 1 |
2 files changed, 6 insertions, 1 deletions
@@ -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) @@ -1 +1,2 @@ bottle +requests |
