Aggarwal | Flask Framework Cookbook | E-Book | www.sack.de
E-Book

E-Book, Englisch, 318 Seiten

Aggarwal Flask Framework Cookbook

Enhance your Flask skills with advanced techniques and build dynamic, responsive web applications
3. Auflage 2023
ISBN: 978-1-80461-000-8
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection

Enhance your Flask skills with advanced techniques and build dynamic, responsive web applications

E-Book, Englisch, 318 Seiten

ISBN: 978-1-80461-000-8
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection



No detailed description available for "Flask Framework Cookbook".

Aggarwal Flask Framework Cookbook jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


Table of Contents - Flask Configurations
- Templating with Jinja
- Data Modeling in Flask
- Working with Views
- Web Forms with WTForms
- Authenticating in Flask
- RESTful API Building
- Admin Interface for Flask Apps
- Internationalization and Localization
- Debugging, Error Handling, and Testing
- Deployment and Post-Deployment
- Microservices and Containers
- GPT with Flask
- Additional Tips and Tricks


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. Who this book is for
If you are a web developer who wants to learn more about developing scalable and production-ready applications in Flask, this is the book for you. You’ll also find this book useful even if you are already aware of Flask’s major extensions and want to use them for better application development. This book can also come in handy if you quickly want to refer to any specific topic on Flask, any of its popular extensions, or some specific use cases. Basic Python programming experience along with some understanding of web development and its related terminology is assumed. 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. To get the most out of this book
You will need Python installed on your computer as a prerequisite. All the code in the book has been written and tested on Python 3.11.x on a UNIX-based OS, either macOS or Ubuntu. The book uses Flask 2.2.x, and not all the code will work for earlier versions of Flask and/or Python. However, most code should work for future versions unless a breaking change is introduced. For other relevant packages or libraries, the versions are mentioned directly in the recipes wherever relevant. Software/hardware covered in the book Operating system requirements Python 3.11.x Windows, macOS, or...


Aggarwal Shalabh:

Shalabh Aggarwal is a seasoned engineering leader who develops and manages enterprise systems and web and mobile applications for small- and large-scale organizations. He started his career working with Python, and although he now works on multiple technologies, he remains a Python developer at heart. He is passionate about open source technologies and writes highly readable and high-quality code. Throughout his career, he has built software products and engineering teams for companies moving from 0 to 1, 1 to 10, and 10 to 100 levels. He is also active in voluntary training for engineering students and young engineers on non-conventional and open source topics. When not working with full-time assignments, he consults for start-ups on starting or scaling up while leveraging different technologies. When not writing code, he dedicates his time to his young kid and occasional travels.



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.