Deploying Flask Web Applications

Deploying Flask Web Applications is an updated book by Matthew Makai that was first released in July 2015 as "The Full Stack Python Guide to Deployments". The book subsequently receieved several smaller revisions and then in Spring 2019 was completely rewritten due to all of the code dependencies for the project as well as reader feedback that helped to clarify confusing parts. There is also a book bundle with a nicely formatted copy of the Full Stack Python website.

Unfortunately, this book is no longer available for purchase because it is not up to date with the latest versions of each tool used in the book. At some point in the future if I have time, I may rewrite it and sell it again.

If you still want to deploy a Flask web app, I strongly recommend purchasing Michael Herman's wonderful book Deploying a Flask and React Microservice.


What's in the book?

Throughout the book you'll take an example open source Python web application through a complete deployment on a virtual private server. In each chapter, we will first learn how to deploy the application manually, to fully understand each step, then automate the steps with Ansible. We also set up a continuous integration server to automate the deployment process once we have our Ansible playbooks in place.

Chapters

  • Chapter 1: Introduction
  • Chapter 2: Servers (DigitalOcean)
  • Chapter 3: Operating Systems (Ubuntu)
  • Chapter 4: Web Servers (Nginx)
  • Chapter 5: Source control (Git)
  • Chapter 6: Databases (PostgreSQL and Redis)
  • Chapter 7: Application Dependencies
  • Chapter 8: WSGI Servers (Gunicorn)
  • Chapter 9: Task Queues (Celery)
  • Chapter 10: Continuous Integration (Jenkins)
  • Chapter 11: Deployment Automation (Ansible)
  • Chapter 12: Server Automation
  • Chapter 13: Operating System Automation
  • Chapter 14: Web Server Automation
  • Chapter 15: Source Control Automation
  • Chapter 16: Database Automation
  • Chapter 17: App Dependencies Automation
  • Chapter 18: WSGI Server Automation
  • Chapter 19: Task Queue Automation
  • Chapter 20: Continuous Integration Automation
  • Chapter 21: What's Next?
  • Appendix A: Glossary

Picture of the Deploying Flask Web Applications book cover. Picture of the Full Stack Python book cover.

In the bundled version you'll also receive a PDF and EPUB copies of the Full Stack Python website content, which clocks in at about 400 pages, shown above.

Here is a visual preview of how we perform a full application deployment together throughout the book:


Book Change Log

2019

April

  • Chapters 1-7 updated and released.
  • Book now uses DigitalOcean instead of Linode.
  • Fabric removed in favor of simplicity with Ansible for all configuration management.
  • Revisions to entire introduction section.
  • Changed the book title from "The Full Stack Python Guide to Deployments" to "Deploying Flask Web Applications" to more accurately represent the content and future directions.
  • Moved book generation to custom toolchain that uses Pelican, pandoc, kindlegen, Prince and a bunch of Python and Bash scripts.

Pre-2019 updates

  • September 2016 edition: Major clarification text and improvements to all chapters based on further reader feedback. Changed from using Ulysses Mac app to Prince PDF generator, pandoc and Kindlegen for ebook generation, which should allow for faster new edition releases. Open sourced and released gitbook-code-highlighter on npm that was built for this book when I was trying to get gitbook working as the generation tool. Updated screenshots for Namecheap and other services.

  • December 2015 edition: Clean up and clarifications on confusing sections throughout chapters 4, 6, 7 and 10. A huge thank you to Zev Averbach for his tweets and issue tickets on GitHub that allowed me to reproduce some problems he had going through several sections.

  • August 2015 edition: Typo and link fixes throughout the book.

  • First edition July 2015: Initial release.

That's all for now. Have you read the Full Stack Python deployment page? :)


Matt Makai 2012-2020