MongoDB + Django Rest Framework CRUD Rest API example
In this tutorial, we’re gonna create Python 3/Django & MongoDB CRUD example with Django Rest Framework for building Rest Apis. You’ll know:
- How to setup Django to connect with MongoDB Database
- How to define Data Models and migrate it to MongoDB
- Way to use Django Rest Framework to process HTTP requests
- Way to make Django CRUD Operations with MongoDB Database
Django MongoDB CRUD Rest API overview
We will build Rest Api using DJANGO REST FRAMEWORK that can create, retrieve, update, delete and find Tutorials by title or published status.
Architecture
This diagram shows the architecture of our Django CRUD Rest Apis App with MongoDB database:
- HTTP requests will be matched by Url Patterns and passed to the Views
- Views processes the HTTP requests and returns HTTP responses (with the help of Serializer)
- Serializer serializes/deserializes data model objects
- Models contains essential fields and behaviors for CRUD Operations with MongoDB Database
Technology
- Python
- Django
- Django Rest Framework
- djongo
- django-cors-headers
- MongoDB