Using the Flask framework for RESTful APIs
Many web applications have several layers. The layers often follow this pattern:
- A presentation layer. This might run on a mobile device or a computer's browser. This is the visible, external view of the application. Because of the variety of mobile devices and browsers, there may be many clients for an application.
- An application layer. This is often implemented as a RESTful API to provide web services. This layer does the processing to support the web or mobile presentation. This can be built using Python and the Flask framework.
- A persistence layer. This handles the retention of data and transaction state over a single session as well as across multiple sessions from a single user. This is often a database, but in some cases the OS filesystem is adequate.
The Flask framework is very helpful for creating the application layer of a web service. It can serve HTML and JavaScript to provide a presentation...