Preface
Flask, the lightweight Python web framework, is popular due to its powerful modular design that lets you build scalable web apps. With this recipe-based guide, you’ll explore modern solutions and the best practices to build web applications using Flask.
Updated to the latest version of Flask 2.2.x and Python 3.11.x, this third edition of Flask Framework Cookbook moves away from some of the old and obsolete libraries and introduces recipes on bleeding-edge technologies. You’ll discover different ways of using Flask to create, deploy, and manage microservices.
This book takes you through a number of recipes that will help you understand the power of Flask and its extensions. You will start by exploring the different configurations that a Flask application can make use of. From here, you will learn how to work with templates, before learning about the ORM and view layers, which act as the foundation of web applications. Then, you will learn how to write RESTful APIs with Flask, after learning various authentication techniques.
As you move ahead, you will learn how to write an admin interface, followed by debugging and logging errors in Flask. You will also learn how to make your applications multilingual and gain insight into the various testing techniques. You will learn about the different deployment and post-deployment techniques on platforms such as Apache, Tornado, NGINX, Gunicorn, Sentry, New Relic, and Datadog. Finally, you will learn about popular microservices tools, such as Docker, Kubernetes, Google Cloud Run, and GitHub Actions, that can be used to build highly scalable services.
A new chapter has been added on the latest technology that is making waves nowadays – that is, GPT. Here, you will learn about some simple and basic yet powerful implementations of GPT to build automated text completion fields, chatbots, and AI-powered image generations. Before you complete the book, you will learn about some additional tips and tricks that will be helpful to handle specific use cases, such as full-text searching, caching, email, and asynchronous operations.
By the end of this book, you will have all the information required to make the best use of this incredible microframework, writing small and big applications and scaling them with industry-standard practices.