[Flask] Flask + mongodb

Badri Sunderarajan badrihippo at gmail.com
Fri Jul 29 07:09:43 EDT 2016


Any library should be fine, as long as you're comfortable with it. Don't 
worry about it not being on the extensions page—many of the newer ones 
may have just not got there yet.

If you're concerned about how active/supported the project is, you could 
look at (for example) the number of stars on GitHub or the date of the 
latest release.

Personally, I found MongoEngine simple (along with the flask-mongoengine 
wrapper), because it works the same way as peewee and other ORMs that 
I'm used to. If your API fits with what flask-mongorest provides, that 
might be a better option for you.

My suggestion would be to try flask-mongorest for a day or two and see 
if it works out. If not, you can switch to a normal ODM like MongoEngine 
or MongoAlchemy. As far as I know they all have similar features, so 
which one you settle on is just a matter of preference. (Though if 
there's a specific feature you need, it would be a good idea to verify 
that your chosen library supports it).

Hope that helps!


More information about the Flask mailing list