Mastering Flask

Gain expertise in Flask to create dynamic and powerful web applications
Preview in Mapt

Mastering Flask

Jack Stouffer

1 customer reviews
Gain expertise in Flask to create dynamic and powerful web applications
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $39.99
Save 74%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$49.99
$29.99 p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Mastering Flask Book Cover
Mastering Flask
$ 39.99
$ 10.00
Mastering Machine Learning Algorithms Book Cover
Mastering Machine Learning Algorithms
$ 35.99
$ 10.00
Buy 2 for $20.00
Save $55.98
Add to Cart

Book Details

ISBN 139781784393656
Paperback288 pages

Book Description

Flask is a library that allows programmers to create web applications in Python. Flask is a micro-framework that boasts a low learning curve, a large community, and the power to create complex web apps. However, Flask is easy to learn but difficult to master.

Starting from a simple Flask app, this book will walk through advanced topics while providing practical examples of the lessons learned. After building a simple Flask app, a proper app structure is demonstrated by transforming the app to use a Model-View-Controller (MVC) architecture. With a scalable structure in hand, the next chapters use Flask extensions to provide extra functionality to the app, including user login and registration, NoSQL querying, a REST API, an admin interface, and more. Next, you’ll discover how to use unit testing to take the guesswork away from making sure the code is performing as it should. The book closes with a discussion of the different platforms that are available to deploy a Flask app on, the pros and cons of each one, and how to deploy on each one.

Table of Contents

Chapter 1: Getting Started
Version control with Git
Python package management with pip
Dependency sandboxing with virtualenv
The beginning of our project
Summary
Chapter 2: Creating Models with SQLAlchemy
Setting up SQLAlchemy
Our first model
CRUD
Relationships between models
The convenience of SQLAlchemy sessions
Database migrations with Alembic
Summary
Chapter 3: Creating Views with Templates
Jinja's syntax
Creating our views
Flask WTForms
Summary
Chapter 4: Creating Controllers with Blueprints
Request setup, teardown, and application globals
Error pages
Class-based views
Blueprints
Summary
Chapter 5: Advanced Application Structure
The project as a module
Application factories
Summary
Chapter 6: Securing Your App
Setting up
Using the session
Flask Login
Summary
Chapter 7: Using NoSQL with Flask
Types of NoSQL databases
RDBMS versus NoSQL
MongoDB in Flask
Leveraging the power of NoSQL
Summary
Chapter 8: Building RESTful APIs
What is REST
Setting up a RESTful Flask API
GET requests
POST requests
PUT requests
DELETE requests
Summary
Chapter 9: Creating Asynchronous Tasks with Celery
What is Celery?
Setting up Celery and RabbitMQ
Creating tasks in Celery
Running Celery tasks
Monitoring Celery
Creating a reminder app
Creating a weekly digest
Summary
Chapter 10: Useful Flask Extensions
Flask Script
Flask Debug Toolbar
Flask Cache
Flask Assets
Flask Admin
Flask Mail
Summary
Chapter 11: Building Your Own Extension
Creating a YouTube Flask extension
Modifying the response with Flask extensions
Summary
Chapter 12: Testing Flask Apps
What are unit tests?
How does testing work?
Unit testing the application
User interface testing
Test coverage
Test-driven development
Summary
Chapter 13: Deploying Flask Apps
Deploying on your own server
Deploying on Heroku
Deploying on Amazon web services
Summary

What You Will Learn

  • Set up a best practices Python environment
  • Use SQLAlchemy to programmatically query a database
  • Develop templates in Jinja
  • Set up an MVC environment for Flask
  • Discover NoSQL, when to use it, when not to, and how to use it
  • Develop a custom Flask extension
  • Use Celery to create asynchronous tasks

Authors

Table of Contents

Chapter 1: Getting Started
Version control with Git
Python package management with pip
Dependency sandboxing with virtualenv
The beginning of our project
Summary
Chapter 2: Creating Models with SQLAlchemy
Setting up SQLAlchemy
Our first model
CRUD
Relationships between models
The convenience of SQLAlchemy sessions
Database migrations with Alembic
Summary
Chapter 3: Creating Views with Templates
Jinja's syntax
Creating our views
Flask WTForms
Summary
Chapter 4: Creating Controllers with Blueprints
Request setup, teardown, and application globals
Error pages
Class-based views
Blueprints
Summary
Chapter 5: Advanced Application Structure
The project as a module
Application factories
Summary
Chapter 6: Securing Your App
Setting up
Using the session
Flask Login
Summary
Chapter 7: Using NoSQL with Flask
Types of NoSQL databases
RDBMS versus NoSQL
MongoDB in Flask
Leveraging the power of NoSQL
Summary
Chapter 8: Building RESTful APIs
What is REST
Setting up a RESTful Flask API
GET requests
POST requests
PUT requests
DELETE requests
Summary
Chapter 9: Creating Asynchronous Tasks with Celery
What is Celery?
Setting up Celery and RabbitMQ
Creating tasks in Celery
Running Celery tasks
Monitoring Celery
Creating a reminder app
Creating a weekly digest
Summary
Chapter 10: Useful Flask Extensions
Flask Script
Flask Debug Toolbar
Flask Cache
Flask Assets
Flask Admin
Flask Mail
Summary
Chapter 11: Building Your Own Extension
Creating a YouTube Flask extension
Modifying the response with Flask extensions
Summary
Chapter 12: Testing Flask Apps
What are unit tests?
How does testing work?
Unit testing the application
User interface testing
Test coverage
Test-driven development
Summary
Chapter 13: Deploying Flask Apps
Deploying on your own server
Deploying on Heroku
Deploying on Amazon web services
Summary

Book Details

ISBN 139781784393656
Paperback288 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Flask By Example Book Cover
Flask By Example
$ 27.99
$ 10.00
Flask Framework Cookbook Book Cover
Flask Framework Cookbook
$ 26.99
$ 10.00
Flask Blueprints Book Cover
Flask Blueprints
$ 35.99
$ 10.00
Building RESTful Python Web Services Book Cover
Building RESTful Python Web Services
$ 39.99
$ 10.00
Building Web Applications with Flask Book Cover
Building Web Applications with Flask
$ 27.99
$ 10.00
Flask: Building Python Web Services Book Cover
Flask: Building Python Web Services
$ 79.99
$ 10.00