Integrating Mongoengine into Pylons is really quick and painless if you know where to put stuff.
mongodb.host = host[,replHost2]
mongodb.port = port
mongodb.db = db_name
mongodb.username = uname
mongodb.password = pass
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'])
Now we can create our models just like in the Mongoengine documentation.