Mastering Flask Web Development: Build enterprise-grade, scalable Python web applications, 2/e (Paperback)

Daniel Gaspar, Jack Stouffer

  • 出版商: Packt Publishing
  • 出版日期: 2018-10-31
  • 售價: $1,400
  • 貴賓價: 9.5$1,330
  • 語言: 英文
  • 頁數: 332
  • 裝訂: Paperback
  • ISBN: 1788995406
  • ISBN-13: 9781788995405
  • 相關分類: FlaskPython程式語言JVM 語言
  • 立即出貨 (庫存=1)



Learn to build modern, secure, highly available web MVC applications and API's using Python`s Flask framework.

Key Features

  • Create production-ready MVC and REST API with the dynamic features of Flask
  • Utilize the various extensions like Flask-JWT and Flask-SQLAlchemy to develop powerful applications
  • Deploy your flask application on real-world platforms like AWS and Heroku on VM's or Docker containers

Book Description

Flask is a popular Python framework known for its lightweight and modular design. Mastering Flask Web Development will take you on a complete tour of the Flask environment and teach you how to build a production-ready application.

You'll begin by learning about the installation of Flask and basic concepts such as MVC and accessing a database using an ORM. You will learn how to structure your application so that it can scale to any size with the help of Flask Blueprints. You'll then learn how to use Jinja2 templates with a high level of expertise. You will also learn how to develop with SQL or NoSQL databases, and how to develop REST APIs and JWT authentication. Next, you'll move on to build role-based access security and authentication using LDAP, OAuth, OpenID, and database. Also learn how to create asynchronous tasks that can scale to any load using Celery and RabbitMQ or Redis. You will also be introduced to a wide range of Flask extensions to leverage technologies such as cache, localization, and debugging. You will learn how to build your own Flask extensions, how to write tests, and how to get test coverage reports. Finally, you will learn how to deploy your application on Heroku and AWS using various technologies, such as Docker, CloudFormation, and Elastic Beanstalk, and will also learn how to develop Jenkins pipelines to build, test, and deploy applications.

What you will learn

  • Develop a Flask extension using best practices
  • Implement various authentication methods: LDAP, JWT, Database, OAuth, and OpenID
  • Learn how to develop role-based access security and become an expert on Jinja2 templates
  • Build tests for your applications and APIs
  • Install and configure a distributed task queue using Celery and RabbitMQ
  • Develop RESTful APIs and secure REST API's
  • Deploy highly available applications that scale on Heroku and AWS using Docker or VMs

Who this book is for

The ideal target audience for this book would be Python developers who want to use Flask and its advanced features to create Enterprise grade and lightweight applications. The book is for those who have some exposure of Flask and want to take it from introductory to master level.

Table of Contents

  1. Getting Started
  2. Creating Models with SQLAlchemy
  3. Creating Views with Templates
  4. Creating Controllers with Blueprints
  5. Advanced Application Structure
  6. Securing Your App
  7. Using NoSQL with Flask
  8. Building RESTful APIs
  9. Creating Asynchronous Tasks with Celery
  10. Useful Flask Extensions
  11. Building Your Own Extension
  12. Testing Flask Apps
  13. Deploying Flask Apps


學習使用Python的Flask框架建立現代、安全、高可用的Web MVC應用程式和API。


- 使用Flask的動態功能建立生產就緒的MVC和REST API。
- 利用Flask-JWT和Flask-SQLAlchemy等擴展開發強大的應用程式。
- 在AWS和Heroku等真實世界平台上部署Flask應用程式,可以使用VM或Docker容器。



您將首先學習有關Flask的安裝和基本概念,例如MVC和使用ORM存取資料庫。您將學習如何結構化應用程式,以便它可以隨著需求擴展。接著,您將學習如何使用Jinja2模板。您還將學習如何使用SQL或NoSQL資料庫開發REST API和JWT驗證。接下來,您將建立基於角色的存取安全性和使用LDAP、OAuth、OpenID和資料庫進行身分驗證。您還將學習如何使用Celery和RabbitMQ或Redis開發可擴展到任何負載的非同步任務。您還將介紹各種Flask擴展,以利用快取、本地化和除錯等技術。您將學習如何建立自己的Flask擴展,如何撰寫測試,以及如何獲得測試覆蓋報告。最後,您將學習如何使用Docker、CloudFormation和Elastic Beanstalk等技術,在Heroku和AWS上部署應用程式,並學習如何使用Jenkins管道建立、測試和部署應用程式。


- 使用最佳實踐開發Flask擴展。
- 實現各種身分驗證方法:LDAP、JWT、資料庫、OAuth和OpenID。
- 學習如何開發基於角色的存取安全性,並成為Jinja2模板的專家。
- 為您的應用程式和API建立測試。
- 安裝和配置使用Celery和RabbitMQ的分散式任務佇列。
- 使用Docker或VM部署高可用應用程式。




1. 開始
2. 使用SQLAlchemy建立模型
3. 使用模板建立視圖
4. 使用藍圖建立控制器
5. 高級應用程式結構
6. 保護您的應用程式
7. 使用Flask的NoSQL
8. 建立RESTful API
9. 使用Celery建立非同步任務
10. 有用的Flask擴展
11. 建立自己的擴展
12. 測試Flask應用程式
13. 部署Flask應用程式