Guide to Flask-MongoEngine in Python

python_tutorials

Introduction

Building a web app almost always means dealing with data from a database. There are various databases to choose from, depending on your preference.

In this guide, we shall be taking a look at how to integrate one of the most popular NoSQL databases – MongoDB – with the Flask micro-framework.

In this guide, we’ll be exploring how to integrate MongoDB with Flask using a popular library – MongoEngine, and more specifically, its wrapper – Flask-MongoEngine.

Alternatively, you can integrate MongoDB with Flask-PyMongo.

Flask-MongoEngine

MongoEngine is an ODM (Object Document Mapper) that maps Python classes (models) to MongoDB documents, making it easy to create and manipulate documents programatically straight from our code.

Setup and Configuration

To explore some of the features of MongoEngine, we’ll be creating a simple movie API that allows us to perform CRUD operations on Movie

 

 

To finish reading, please visit source site