Last active
December 19, 2015 05:19
-
-
Save fmasanori/5903268 to your computer and use it in GitHub Desktop.
CRUD Web MongoDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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