Skip to content

Instantly share code, notes, and snippets.

@fmasanori
Last active December 19, 2015 05:19
Show Gist options
  • Save fmasanori/5903268 to your computer and use it in GitHub Desktop.
Save fmasanori/5903268 to your computer and use it in GitHub Desktop.
CRUD Web MongoDB
import bottle
import pymongo
@bottle.route('/')
def index():
from pymongo import MongoClient
connection = MongoClient("mongodb://localhost")
db = connection.test
names = db.names
item = names.find_one()
return '<b>Hello %s!</b>' %item['name']
bottle.run(host='localhost', port = 8082)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment