Posts tagged pymongo
Integrating Mongoengine into Pylons is really quick and painless if you know where to put stuff.
Add your DB settings to your development.ini file
mongodb.host = host[,replHost2]
mongodb.port = port
mongodb.db = db_name
mongodb.username = uname
mongodb.password = pass
Connect to MongoDB in config/environment.ini
At the top, include Mongoengine
from mongoengine import connect
And at the bottom, just before we return, include the following line:
# Connect with Mongoengine
connect(config['mongodb.db'], host=config['mongodb.host'], port=int(config['mongodb.port']), username=config['mongodb.username'], password=config['mongodb.password'])
Add your models
Now we can create our models just like in the Mongoengine documentation.
Socialgraph is an open-source project I just launched over the weekend that aims to be a server-to-client relationship visualization platform.
Rather than me trying to explain the whole thing, a picture is worth a thousand words, and an interactive demo is worth a million.
Seriously. Check it out.