28,79 €
Discover what makes Flask, the lightweight Python web framework, popular, as you delve into its modular design that enables the development of scalable web apps. With this practical guide, you'll explore modern solutions, recommended design patterns, and best practices for Flask web development.
Updated to the latest version of Flask and Python, this third edition of the Flask Framework Cookbook moves away from the outdated libraries, updates content to incorporate new coding patterns, and introduces recipes for the latest tools. You'll explore different ways to integrate with GPT to build AI-ready Flask applications. The book starts with an exploration of Flask application configurations and then guides you through working with templates and understanding the ORM and view layers. You’ll also be able to write an admin interface and get to grips with testing using the factory pattern, debugging, and logging errors. Then you’ll discover different ways of using Flask to create, deploy, and manage microservices using AWS, GCP, and Kubernetes. Finally, you’ll gain insights into various deployment and post-deployment techniques for platforms such as Apache, Tornado, and Datadog.
By the end of this book, you'll have acquired the knowledge necessary to write Flask applications that cater to a wide range of use cases in the best possible way and scale them using standard industry practices.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 318
Veröffentlichungsjahr: 2023
Enhance your Flask skills with advanced techniques and build dynamic, responsive web applications
Shalabh Aggarwal
BIRMINGHAM—MUMBAI
Copyright © 2023 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Pavan Ramchandani
Publishing Product Manager: Bhavya Rao
Senior Editor: Divya Anne Selvaraj
Technical Editor: Joseph Aloocaran
Copy Editor: Safis Editing
Project Coordinator: Sonam Pandey
Proofreader: Safis Editing
Indexer: Manju Arasan
Production Designer: Alishon Mendonca
Marketing Coordinator: Nivedita Pandey
First published: November 2014
Second edition: July 2019
Third edition: June 2023
Production reference: 1300623
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80461-110-4
www.packtpub.com
To my late father, Videsh, who will always be there in my thoughts for the love and encouragement he gave me to explore new things in life.
– Shalabh Aggarwal
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.
I would like to thank my family, my wife, and my mother for putting up with me during my long writing and research sessions. Special thanks to my three-year-old son, Krishiv, for it was his time that was sacrificed the most. Thanks also to the Pocoo and Pallets teams, Armin Ronacher, and the complete Flask community for developing and maintaining the framework that made this series of books possible.
Vincenzo Antignano, hailing from Naples, Italy, is a software engineer who specializes in finding solutions and leading developers to make successes of products. He currently works at IQVIA.
He has 10 years of experience in Python and has worked extensively with Flask in many projects in the last few years, from leading the dev team that boosted the acclaimed Google Outside Campaign in London to designing and implementing data and APIs for the clinical trial and life science industry.
Rahul Shelke is a seasoned technology professional with over 13 years of experience in software architecture, development, cybersecurity, and DevOps tools. He is passionate about helping start-ups succeed. He is a curious person and a fluid thinker. He likes sharing insights on software, cybersecurity, and personal growth by simplifying complex topics. As a skilled trainer and mentor, he has trained teams and created automated development standards. He advises start-ups on product development, architecture design, team hiring, and coaching, and he has contributed to open source communities. Rahul has also done technical reviews for other Packt Publishing books on web development using Python Flask.
Thank you, Packt Publishing, for giving me the opportunity to do the technical review for this book. A special thanks to the editorial team and coordinator for their constant support and patience. I would also like to thank my family, who have been my unwavering source of support and motivation. Finally, I would like to acknowledge the author of this book for his dedication and hard work. His expertise and passion for the subject matter are evident in every chapter, and it has been an honor to work with him..
As the name suggests, this part of the book focuses on the basic fundamental building blocks of any Flask web application. A clear understanding of these topics is essential to building scalable, configurable, and extensible web applications with Flask as we move to more complex topics.
Developers usually struggle with how to set up their Flask application configurations to suit different environments, such as development and production. At times, they might find it difficult to choose the best way to structure their Flask applications. The first chapter helps in answering such questions and many more.
The next three chapters focus on creating the foundational pillars of any web application – that is, models, views, and templates. A very important concept covered in these chapters concerns connecting multiple types of databases with your application.
The content in these chapters will be basic- to mid-level in complexity, and it will act as the groundwork to address more complex use cases in the next two parts of the book.
At the end of this first part of the book, you will be able to create a full-fledged Flask application that will be functional and capable of basic functionalities.
This part of the book comprises the following chapters:
Chapter 1, Flask ConfigurationsChapter 2, Templating with JinjaChapter 3, Data Modeling in FlaskChapter 4, Working with Views