This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
1 |
import json |
2 |
import pymongo |
3 |
def application(environ, start_response): |
4 |
status = '200 OK' |
5 |
response_headers = [('Content-type', 'text/html'),('Access-Control-Allow-Origin', '*')] |
6 |
start_response(status, response_headers) |
7 |
recieved = environ['wsgi.input'].read(int(environ['CONTENT_LENGTH'])) |
8 |
c = pymongo.Connection() |
9 |
db = c['mural'] |
10 |
coll = db['data'] |
11 |
d = json.loads(recieved) |
12 |
for i in d: |
13 |
coll.insert(d) |
14 |
return 'ok' |