Introduction

In this article, we will see how to use MongoDB, a non-relational database, with Django, a Python Web Framework.

Django is commonly used with PostgreSQL, MariaDB or MySQL, all relational databases, due to it’s ORM under the hood. MongoDB, being quite flexible, is commonly paired with lightweight frameworks such as Flask for the ease of prototyping. However, is also increasingly being used in larger projects due to scalability, dynamic structures and query support.

The Django MongoDB Engine is used to declaratively define schemas.

Note: At the time of writing, this engine doesn’t have the support for Python 3.x. The latest supported version is Python 2.7.

Non-relational vs Relational Databases

Installation and Setup

Models and Fields

Embedded Models

File Handling

Conclusion

#python #django #web development

Guide to Using The Django MongoDB Engine with Python
1.30 GEEK