Python Web Development with Flask (2nd edition)
A newer and better Flask book available in Chinese.- The first Flask book in China, it covering the complete Flask Web development learning path and including the complete Flask Web application development process.
- The book based on Flask 3.0.x. Besides, all the Python packages, CSS frameworks and JavaScript libraries use the latest version.
- In addition to basic knowledge, it also covered Web API, full-text search, third-party login, AJAX, source code analysis and other practical contents.
- It comes with 8 example application, 2 real-world projects. See more information below.
- All chapters of the book have been carefully designed and arranged to meet the needs of different levels of readers, and to allow readers to master the basics and skills of Flask development step by step.
Companion Applications
-
Flask Examples
A collection of simple Flask applications that demonstrates the basic usages of Flask, including http, template, form, database, email, cache and assets profiling.
Hello, Flask!
Table of Contents
This book is divided into three parts, with a total of 14 chapters.
Basics
- Chapter 1 Introduction to Flask
Setting up the development environment, writing a minimal Flask program, running it, and understanding the basics of Flask. - Chapter 2 Flask and HTTP
Introduction to the interaction between Flask and HTTP, as well as relevant Flask features. - Chapter 3 Templates
Usage and techniques of Jinja2 templates; using and integrating the CSS framework Bootstrap. - Chapter 4 Forms
Creating web forms and validating form data. - Chapter 5 Database
Using SQLAlchemy for CRUD operations on databases within a Flask program, establishing and operating various database relationship models. - Chapter 6 Automated Testing
Introduction to automated testing for Flask programs, including test writing, calculating test coverage, code quality checks, type annotation checks, etc.
Practical Applications
- Chapter 7 Advanced Flask Practices
Introduction to advanced techniques in Flask web development, including file uploads, email, AJAX, rich text editors, etc. - Chapter 8 Project Organization
Introduction to organization methods and techniques for Flask projects, including factory functions, blueprints, and configuration management. - Chapter 9 Personal Blog
Introduction to CRUD operations, user authentication, article comments, management backend, etc., through the personal blog program Greybook. - Chapter 10 Image Social Network
Introduction to user registration and authentication, user permission management, image upload and processing, user avatars, complex database relationships, complex database queries, full-text search, etc., through the image social program Moments.
Advanced Topics
- Chapter 11 Web API Development
Introduction to Web API design and using APIFlask for Web API development. - Chapter 12 Performance Analysis and Optimization
Introduction to main measures for optimizing the performance of Flask programs, including performance analysis of functions and database queries, cache usage, and static file optimization. - Chapter 13 Deployment
Introduction to preparations before deploying Flask programs, as well as traditional deployment (deploying to Linux servers) and container deployment. - Chapter 14 Analysis of Flask's Working Principles and Mechanisms
Introduction to some design concepts of Flask, including the underlying WSGI implementations, and source code analysis of major functionalities.
Recommendations
Grey Li is a really helpful contributor to Flask and the Python community. He is making it easier for more people to learn and use Flask.
——David Lord, the leader of Pallets Team
This book is detailed and is recommended for those who want to systematically learn Flask. Don't miss the small knowledge points in the book!
——Hsiaoming Yang, the member of Pallets Team
This book is very interesting and will be helpful to readers. As a fan of the Flask framework, I am also looking forward to the publication of this book.
——Jianhong Huang, the author of The Design and Implementation of Redis