What this book covers
Chapter 1, Flask Configurations, explains the different ways in which Flask can be configured to suit the various needs of any project. It starts by telling us how to set up a development environment and moves on to the different configuration techniques.
Chapter 2, Templating with Jinja, covers the basics of Jinja2 templating from the perspective of Flask and explains how to make applications with modular and extensible templates.
Chapter 3, Data Modeling in Flask, deals with one of the most important parts of any application – that is, its interaction with database systems. We will see how Flask can connect to different database systems, define models, and query databases to retrieve and feed data.
Chapter 4, Working with Views, deals with the core of web frameworks. It talks about how to interact with web requests and the proper responses to these requests. It covers various methods of handling requests properly and designing them in the best way.
Chapter 5, Web Forms with WTForms, covers form handling, which is an important part of any web application. As much as forms are important, their validation holds equal importance, if not more. Presenting this information to users in an interactive fashion adds a lot of value to an application.
Chapter 6, Authenticating in Flask, talks about authentication, which acts as the red line between an application being secure and insecure. It deals with multiple social and enterprise login techniques in detail. Authentication is an important part of any application, be it web-based, desktop, or mobile.
Chapter 7, RESTful API Building, explains REST as a protocol and then discusses writing RESTful APIs for Flask applications using libraries, as well as completely customized APIs. An API can be summarized as a developer’s interface to an application.
Chapter 8, Admin Interface for Flask Apps, focuses on writing admin views for Flask applications. First, we will write completely custom-made views and then write them with the help of an extension. As opposed to the very popular Python-based web framework Django, Flask does not provide an admin interface by default. Although this can be seen as a shortcoming by many, this gives developers the flexibility to create an admin interface as per their requirements and have complete control over an application.
Chapter 9, Internationalization and Localization, expands the scope of Flask applications and covers the basics of how to enable support for multiple languages. Web applications usually are not limited to one geographical region or to serving people from one linguistic domain. For example, a web application intended for users in Europe will be expected to support other European languages, such as German, French, Italian, Spanish, and so on, apart from English.
Chapter 10, Debugging, Error Handling, and Testing, moves on from being completely development-oriented to testing our application. With better error handling and tests, the robustness of the application increases manifold, and debugging makes the lives of developers easier. It is very important to know how robust our application is and to keep track of how it has worked and performed. This, in turn, gives rise to the need to be informed when something goes wrong in the application. Testing in itself is a very huge topic and has several books devoted to it.
Chapter 11, Deployment and Post-Deployment, covers the various ways and tools with which an application can be deployed. Then, you will learn about application monitoring, which helps us to keep track of the performance of the application. Deployment of an application and managing the application post-deployment is as important as developing it. There can be various ways of deploying an application, and choosing the best way depends on the requirements.
Chapter 12, Microservices and Container, explores how to package Flask applications with Docker and deploy them with Kubernetes. We will also see how to serve applications in a serverless fashion by leveraging Google Cloud Run and GitHub Actions. Microservices is one of the biggest buzzwords in modern software technology. These are as useful as they are popular and make the lives of developers easier. They allows people to focus on development rather than investing that time in thinking about the deployment of applications.
Chapter 13, GPT with Flask, implements some of the most popular and common yet powerful APIs of GPT to build AI-powered apps with Flask. We will see how easy it is to automate text completions using GPT to build highly user-intuitive search fields. Then, a simple chatbot implementation using ChatGPT is demonstrated, followed by AI-powered image generation.
Chapter 14, Additional Tips and Tricks, covers some additional recipes that can be used to add value to an application, if necessary.