What is Flask
Tags: python, flask
Published: 2019-11-15 13:11:03

---
title: What is Flask
tags: python, flask
cover_image: https://cdn.pixabay.com/photo/2016/03/09/09/17/computer-1245714__340.jpg
published: true
---
<a href="https://flask.palletsprojects.com/">Flask</a> is a web framework that offers tools, libraries, and technologies suitable for building a web application. This web application can come in the form of web pages, blogs, or even an extensive web-based calendar app or a commercial site.

Flask is one of the best <a href="https://en.wikipedia.org/wiki/Microframework">micro-frameworks</a>, as it has little to no dependencies on external libraries. 

You can use it to make all kinds of web apps.

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse4.mm.bing.net%2Fth%3Fid%3DOIP.lWmYX1gGBmDIXdibUAgIFwHaGy%26pid%3DApi&f=1">

An advantage of using Flask might be the fact that this framework is light, and the risk for encountering <a href="https://pythonhosted.org/Flask-Security/">Flask security</a> bugs is minimal. 

At the same time, a drawback might be the fact that it requires quite some effort from the part of the programmer in order to boost the list of dependencies via plugins. 
 
You should know the <a href="https://pythonbasics.org">basics of Python</a> programming before <a href="https://pythonbasics.org/flask-tutorial-hello-world/">learning Flask</a>.

## Main components of Flask

Flask is interconnected to two main parts. 

* <a href="https://www.palletsprojects.com/p/werkzeug/">Werkzeug</a> is a utility library meant for usage with the Python language. Mostly, it is a Web Server Gateway Interface or WSGI app that can create software items for request, response, or utility functions. 

* <a href="https://www.palletsprojects.com/p/jinja/">Jinja</a> is a template engine for Python programming purposes, and it resembles the Django web frameworks templates. 
 
## Flask configuration

Similar to other Python libraries, the Flask package can be installed from the <a href="https://pypi.org/project/Flask/">Python Package Index</a>. It sets up a directory to function in, after which the Flask package is installed. Mostly, the Flask application has a direct and straightforward way of accessing a SQL 

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fthumbs.gfycat.com%2FRareScornfulAfricanwilddog-size_restricted.gif&f=1&nofb=1">

## Database. 

A great thing about Flask is the <a href="https://flask.palletsprojects.com/en/1.1.x/templating/">template engine</a> available. The purpose of such templates is to allow basic layout configuration for web pages with the purpose of mentioning which element is susceptible to change. 

<img src="https://thepracticaldev.s3.amazonaws.com/i/ok3jpnt67gms7vdfzl77.png">

As such, you will be able to define your template once and keep it the same all over the pages of a website. With the aid of a template engine, you will be able to save a lot of time when setting up your application, and even when it comes to updates or maintenance issues. 
 
## Flask main features

So you know a bit about Flask. What are the main features?

1. Features development servers and debugger functionalities;
2. It comes with integrated aid for unit testing;
3. It uses <a href="https://www.palletsprojects.com/p/jinja/">Jinja2 template styles</a>;
4. It is <a href="https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface">WSGI compliant</a>;
5. It is based on Unicode;
6. It is suitable for <a href="https://cloud.google.com/appengine/">Google App Engine</a>;
7. It offers access to extensions to better functionalities;
8. It allows the creation of secure cookies.
 
Overall, Flask is easy to learn and manage as a scalable tool. It allows any type of approach or programming technique, as there are no restrictions included on the app architecture or data abstraction layers. 

You can even run it on embedded systems like a Raspberry Pi. Your web app can be loaded on any device, including mobile phone, desktop pc or even a tv.

<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.instructables.com%2FFCV%2F4Z20%2FIE223RYD%2FFCV4Z20IE223RYD.RECT2100.jpg&f=1&nofb=1" width="80%">

Besides, it benefits from a community that offers support and solutions suggestions to a multitude of problems that programmers might face when using Flask in Python. The core benefit of Flask is that the programmer controls everything, while he or she will get a deeper understanding of how internal mechanics of frameworks function. 

**Related links:**
* <a href="https://flask.palletsprojects.com/">Flask homepage</a>
* <a href="https://pypi.org/project/Flask/">Flask on Python Package Index</a>
* <a href="https://pythonbasics.org/flask-tutorial-hello-world/">Flask beginners tutorial</a>