Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Flask Framework Cookbook

You're reading from   Flask Framework Cookbook Enhance your Flask skills with advanced techniques and build dynamic, responsive web applications

Arrow left icon
Product type Paperback
Published in Jul 2023
Publisher Packt
ISBN-13 9781804611104
Length 318 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Shalabh Aggarwal Shalabh Aggarwal
Author Profile Icon Shalabh Aggarwal
Shalabh Aggarwal
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Part 1: Flask Fundamentals
2. Chapter 1: Flask Configurations FREE CHAPTER 3. Chapter 2: Templating with Jinja 4. Chapter 3: Data Modeling in Flask 5. Chapter 4: Working with Views 6. Part 2: Flask Deep Dive
7. Chapter 5: Web Forms with WTForms 8. Chapter 6: Authenticating in Flask 9. Chapter 7: RESTful API Building 10. Chapter 8: Admin Interface for Flask Apps 11. Chapter 9: Internationalization and Localization 12. Part 3: Advanced Flask
13. Chapter 10: Debugging, Error Handling, and Testing 14. Chapter 11: Deployment and Post-Deployment 15. Chapter 12: Microservices and Containers 16. Chapter 13: GPT with Flask 17. Chapter 14: Additional Tips and Tricks 18. Index 19. Other Books You May Enjoy

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.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime