CURD Operations using Flask and MongoDB
What is Web Framework?
Web Application Framework or simply Web Framework represents a collection of libraries and modules that enables a web application developer to write applications without having to bother about low-level details such as protocols, thread management, etc.
FLASK
Flask is a web application framework written in Python. Armin Ronacher, who leads an international group of Python enthusiasts named Pocco, develops it. Flask is based on Werkzeug WSGI toolkit and Jinja2 template engine. Both are Pocco projects.
MongoDB
you can read my full blog post for MongoDB:
https://all-about-devops.blogspot.com/2021/05/ea-case-study.html
WSGI
Web Server Gateway Interface (WSGI) has been adopted as a standard for Python web application development. WSGI is a specification for a universal interface between the web server and the web applications.
Werkzeug
It is a WSGI toolkit, which implements requests, response objects, and other utility functions. This enables building a web framework on top of it. The Flask framework uses Werkzeug as one of its bases.
Jinja2
Jinja2 is a popular templating engine for Python. A web templating system combines a template with a certain data source to render dynamic web pages.
CURD Application
- Create - Create or insert operations add new documents to a collection. If the collection does not currently exist, insert operations will create the collection.
- Update - Update operations modify existing documents in a collection.
- Read - Read operations retrieve documents from a collection that means to query a collection for documents.
- Delete - Delete operations remove documents from a collection.
so for each operation I have created different routes and using these routs I managing all these operations so let's see one by one
1. Connectivity:
So for working with flask, we need a flask package and for connecting with MongoDB we need PyMongo Package, and using the "pip" command you can install these packages.
GitHub Link:
https://github.com/venkateshpensalwar/Python-Flask-applications
Tutorial:
Conclusion:
In this way, we can create a CURD app, and we have seen that it is very easy to code we just used some routes and several lines of code so using some more logic you can also create an amazing application using FLASK and MongoDB.
Hope This Blog helpful to you!!!
No comments