--- id: flask-mongoengine version: "1.0.0" license: BSD license_treatment: permissive maintenance: dormant --- # flask-mongoengine — Flask-MongoEngine is a Flask extension that provides integration with MongoEngine and WTF model forms. License: permissive · Maintenance: dormant · Downloads: 100.1K/mo ## What it is and what it does Flask-MongoEngine is a Flask extension that bridges Flask applications with MongoEngine, a MongoDB object-document mapper. It manages MongoDB connections for your app, handles initialization via the extension pattern (immediate or deferred via init_app), and automatically generates WTForms from your MongoEngine document models. The package also extends MongoEngine's QuerySet with Flask-specific helpers like get_or_404, first_or_404, and pagination methods, plus optional session storage in MongoDB and debug toolbar integration. You define your data models as MongoEngine documents, then use model_form() to automatically create WTForms from them. The extension handles field type mapping (StringField to TextAreaField, ReferenceField to SelectField, ListField to FieldList, etc.) and supports customization hints. Connection configuration is straightforward via app.config dictionaries or individual MONGODB_* settings, with support for URI-style connections and authentication. Use it for: - Build a Flask web app with MongoDB as the primary database, letting the extension manage connections and model integration. - Generate HTML forms automatically from MongoEngine document definitions without writing form classes manually. - Add pagination to query results and template rendering with built-in paginate() and paginate_field() QuerySet methods. - Store Flask sessions in MongoDB instead of memory or Redis using MongoEngineSessionInterface. - Debug MongoDB queries in Flask-DebugToolbar by registering the MongoDebugPanel. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Flask-MongoEngine integrates MongoEngine document models with Flask, handling MongoDB connection management and providing WTForms model form generation for your MongoEngine documents. Yes, with conditions. Flask-MongoEngine is stable and low-friction to install, with no known vulnerabilities and a permissive license. However, it is dormant—last release 2020-11-21, last commit 2024-01-18—so it may lag behind current Flask or MongoEngine releases. Install it if you are working with a compatible Flask and MongoEngine stack; do not expect active maintenance or rapid fixes for compatibility issues. ## Install pip install flask-mongoengine uv add flask-mongoengine poetry add flask-mongoengine ## Installing flask-mongoengine Before you install: Low install friction with a pure-wheel distribution. However, the package is dormant—last release was 2020-11-21 and last commit 2024-01-18—so maintenance is minimal. It still receives downloads but expect no active support for newer Flask or MongoEngine versions. License in practice: BSD license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely as long as you retain the BSD license notice. Quickstart: pip install flask-mongoengine from flask import Flask from flask_mongoengine import MongoEngine app = Flask(__name__) app.config['MONGODB_SETTINGS'] = {'db': 'mydb', 'host': 'localhost'} db = MongoEngine(app) Requires a running MongoDB instance; by default expects mongod on localhost:27017. Connection settings must be configured via app.config before or after initialization. Verify before relying: - Compatibility with current Flask and MongoEngine versions (last release 2020-11-21) - Whether dormant status indicates unresolved issues with modern Python versions or newer dependencies - Support for async/await patterns in modern Flask applications ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 100.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flask mongodb integration, mongoengine flask extension, mongodb orm for flask, flask document database, mongoengine wtforms, flask mongo connection management, document model forms flask, mongodb-orm, flask-extension, form-generation [View on SkillFed](https://skillfed.io/packages/flask-mongoengine) · [View on PyPI](https://pypi.org/project/flask-mongoengine/)