import bottle, pymongo
from pymongo import MongoClient
client = pymongo.MongoClient(some URI)
db = client['database']
dbcoll = db['collection']
@bottle.route('/hello')
def grab_record(name):
bottle.response.headers['Access-Control-Allow-Origin'] = '*'
return dbcoll.find_one({'_id':False})
bottle.run(host='localhost', port=8080, debug=True)
On opening http://localhost:8080/hello, this is the error I get:
Both bottle.py and this file are on my Desktop. What should I do?