What Is Python Flask?
A free, high-level, open-source web framework for easy development of web applications.
Flask is a free, high-level, open-source web framework that lets you develop web applications easily. It was developed by Armin Ronacher, who led a team of international Python enthusiasts called Poocco. According to Ronacher, the idea was originally an April Fool’s joke that was popular enough to make into a serious application. Flask has a small and easy-to-extend core that does not include extras like an ORM (Object Relational Mapper), user authentication, etc. However, Flask does have many cool features like URL routing, a template engine, etc.
Components Of Flask
Even though the Flask micro-framework does not include most of the extras or tools needed for web development, It has these main features which are the basic tools needed for web development, and other Python modules can be used in conjunction with these main components.
1. Werkzeug
Werkzeug (the German word for “tool”) is a library for the Python programming language, in other words, a toolkit for Web Server Gateway Interface (WSGI) applications. WSGI is a specification for a universal interface between web servers and web applications. Werkzeug is one of the most advanced WSGI modules that contain various tools and utilities to facilitate web application development.
2. Jinja
Jinja is a template rendering engine for the Python programming language and is licensed under a BSD License. Similar to the Django web framework, it handles templates in a sandbox. It renders the web pages for a web server with any specified custom content given to it by the webserver. Flask renders its HTML-based templates using Jinja 2.
3. MarkupSafe
MarkupSafe is a string handling library for the Python programming language. MarkupSafe escapes characters so it is safe to use them in HTML and XML. Characters that have special meanings are replaced so that they display as the actual characters. This mitigates injection attacks, meaning untrusted user input can safely be displayed on a page.
4. ItsDangerous
ItsDangerous is a safe data serialization library for the Python programming language. It is used to store the session of a Flask application in a cookie without allowing users to tamper with the session contents.
My Conclusion
Flask is very lightweight and extremely easy to get started with. I mean, I watched a few Flask videos on YouTube and I can say that I’ve been able to develop a few hobby projects which are quite complicated yet were easy to implement with Flask.
And that’s it for this topic. To learn more about Python programming, check out the books listed below.
If you liked this story, do not hesitate to follow me and applaud for more stories like this.
Happy Coding!!!
More content at plainenglish.io. Sign up for our free weekly newsletter. Get exclusive access to writing opportunities and advice in our community Discord.