Flask-MongoEngine is a Flask extension that provides integration with MongoEngine, WtfForms and FlaskDebugToolbar.
By default, Flask-MongoEngine will install integration only between Flask and MongoEngine. Integration with WTFForms and FlaskDebugToolbar are optional and should be selected as extra option, if required. This is done by users request, to limit amount of external dependencies in different production setup environments.
All methods end extras described below are compatible between each other and can be used together.
# For Flask >= 2.0.0
pip install flask-mongoengine
We still maintain special case for Flask = 1.1.4 support (the latest version in 1.x.x
branch). To install flask-mongoengine with required dependencies use legacy
extra option.
# With Flask 1.1.4 dependencies
pip install flask-mongoengine[legacy]
Flask-mongoengine can be installed with Flask-WTF and WTFForms support. This will extend project dependencies with Flask-WTF, WTFForms and related packages.
# With Flask-WTF and WTFForms dependencies
pip install flask-mongoengine[wtf]
Flask-mongoengine provide beautiful extension to FlaskDebugToolbar allowing to monitor all database requests. To use this extension FlaskDebugToolbar itself required. If you need to install flask-mongoengine with related support, use:
# With FlaskDebugToolbar dependencies
pip install flask-mongoengine[toolbar]
# With Flask-WTF, WTFForms and FlaskDebugToolbar dependencies
pip install flask-mongoengine[wtf,toolbar]
Flask-mongoengine does not provide any configuration defaults. User is responsible for setting up correct database settings, to exclude any possible misconfiguration and data corruption.
There are several options to set connection. Please note, that all except recommended are deprecated and may be removed in future versions, to lower code base complexity and bugs. If you use any deprecated connection settings approach, you should update your application configuration.
Please refer to complete connection settings description for more info.
Full project documentation available on read the docs.
We are welcome for contributors and testers! Check Contribution guidelines.
Flask-MongoEngine is distributed under BSD 3-Clause License.