Flask web application framework
We used the node.js
framework to write IoT programs in Chapter 7. Let's create web applications in Python similar to what we did in Chapter 7. There are many HTTP frameworks available in Python. Most popular Python web application frameworks follow Model-View-Controller (MVC) design for coding, for example Django, and web2py. This design itself is a learning curve. So, we will skip them and choose another popular web framework that does not enforce MVC. Flask is an open source, lightweight web application framework for Python. Web applications can be written quickly in a single file. The
Hello World program written on the Flask website homepage (which prints Hello World in the web browser) is just seven lines long. Flask web apps are more lightweight than MVC, which is good for embedded systems. Flask follows Web Server Gateway Interface (WSGI) specifications, which helps to create portable web applications. Many interesting web applications are written in...