Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 587 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 587 Bytes

Flask-PyMongo

PyMongo support for Flask applications

Quickstart

from flask import Flask
from flask.ext.pymongo import PyMongo

app = Flask(__name__)
mongo = PyMongo(app)

@app.route('/')
def home_page():
    online_users = mongo.db.users.find({'online': True})
    return render_template('index.html',
        online_users=online_users)

More Info