𝔖 Scriptorium
✦   LIBER   ✦

📁

The Definitive Guide to Masonite: Building Web Applications with Python

✍ Scribed by Christopher Pitt, Joe Mancuso


Publisher
Apress
Year
2020
Tongue
English
Leaves
215
Edition
1
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Build fast and effective applications using Masonite, a Python-based framework. This book covers creating a digital home assistant application, but it’s certainly not the only kind of application you could build. By working on this kind of project, you’ll cover the broad range of topics and requirements you’re likely to find as you establish your own web empire. 

You’ll see how Masonite is a developer-centric Python framework, which provides all the tools you’ll need to build powerful and maintainable web applications. After reading and using this book, you'll have the tools to make and deploy your own web ecommerce application from scratch using the Masonite framework.  

What You Will Learn

  • Customize your request and response cycle with middleware, route groups, and headers
  • Add security into your application and protect against possible vulnerabilities
  • Create and control your application’s maintenance features from a terminal
  • Manage a database, so your teammates and environments will always be in sync
  • Represent relational database data with object-oriented programming techniques
  • Read and write from the file system
  • Process large datasets and slow operations in the background
  • Add real-time features and recurring tasks to your application

Who This Book Is For

Web developers new to the Masonite framework. Some prior Python experience is helpful but is not required.  

✦ Table of Contents


Table of Contents
About the Authors
About the Technical Reviewers
Chapter 1: Getting Started
“Where Do I Begin?”
How Masonite Handles Releases
Should I Upgrade?
What Does an Upgrade Entail?
How Often Does This Happen?
Installing the Dependencies
Installing Python and MySQL on macOS
Installing Python and MySQL on Linux
Editing Code
Setting Up in Other Environments
Creating a New Masonite Application
Exploring the Masonite Folder Structure
Planning the Example Application
Summary
Chapter 2: Routing
“How Does Masonite Handle Requests?”
Creating Controllers and Routes
Creating Different Kinds of Routes
Different Methods
Different Parameters
Route Groups
Exploring Request and Response
Reading and Writing Cookies
Sending Other Kinds of Responses
Creating Views
Starting the Example Application
Summary
Chapter 3: The Service Container
The Problem We Are Solving
Type Hinting
Service Providers
The Register Method
The Boot Method
The WSGI Attribute
More on Binding
Class vs. Object Behavior
Binding Singletons
Simple Binding
Resolving Classes
Hooks
On Make
On Bind
On Resolve
Swapping
Design Pattern Knowledge
Coding to Abstractions
Dependency Injection
Inversion of Control (IoC)
Implementing Abstractions
Setting Up Our Abstraction
Swapping Out Loggers
Remembering
Collecting
Collecting by Key
Collecting Objects
Application
The Package
Abstraction Class
Concrete Class
The Service Provider
The Controller
Creating the Controller
Setting Up the Controller
Refresher on Abstractions and Concretions
The Route
Chapter 4: Accepting Data with Forms
“How Do I Store Data?”
Building Secure Forms
Template Conditionals
Template Filters
CSRF Protection
Validating Form Data
Fetching Remote Data
Resolving Dependencies from the Container
Summary
Chapter 5: Using a Database
How Do I Store Data?
Keeping the Database in Code
Filling the Database with Dummy Data
Writing to the Database
Reading from the Database
Filtering Database Data
Updating Database Data
Deleting Database Data
Simplifying Code Through Models
Summary
Chapter 6: Security
CSRF Protection
Cleaning Request Input
The CSRF Token
Form Submissions
AJAX Calls
Password Reset
The Form
Unicode Attack
SQL Injection
Query Binding
Mass Assignment
Fillable
CORS
CORS Provider
Secure Headers
Meaning of the Headers
Using the Secure Middleware
Releases
CVE Alerts
Encryption
Encoding vs. Encryption
Password Encryption
Cookies
Signing on Your Own
Chapter 7: Authentication
How do I Authenticate Users?
Using the Tools Provided
Wait, Haven’t I Seen “User” Things Already?
How Do I Use Different Fields?
How Do I Log the User in Automatically?
Logging the User Out
Using Tokens (JWT) Instead of Credentials
How Do I Protect Parts of My App?
How Do I Ensure Valid Emails?
Summary
Chapter 8: Creating Middleware
Constructing Middleware
Initializer
The before Method
The after Method
Registering Middleware
HTTP Middleware
Route Middleware
Using the Middleware
Middleware Stacks
Chapter 9: Using Helpers
The Request and Auth Helpers
The Route Helper
The Container and Resolve Helpers
The Env and Config Helpers
The Dump-and-Die Helper
Summary
Chapter 10: Doing Work in the  Background
How Do I Speed Up My Application with Queues?
When and Where Do I Use Queueing?
Finding Files to Cache
Creating Jobs
Downloading Files
Showing Downloaded Files
Using Different Queue Providers
AMPQ/RabbitMQ
Database
Summary
Chapter 11: Adding Websockets with Pusher
“Isn’t That Ajax?”
Installing Pusher
Integrating Pusher on the Front End
Creating Commands
Integrating Pusher on the Back End
Acting on Received Messages
Summary
Chapter 12: Testing
What Is Integration Testing?
Why Tests in the First Place?
Where Do Our Tests Live?
Creating Tests
Our First Test
Given When Then
Test-Driven Development
Factories
Creating Factories
Using Factories
Asserting Database Values
Testing Environments
Chapter 13: Deploying Masonite
The Request Life Cycle
The Web Server
Setting Up the Server
The Options
Connecting to the Server
Web Server Software
Installing NGINX
Setting Up Python Software
Configuring NGINX
Reloading NGINX
Testing Everything Worked
Set Up Tasks
Setting Up Our Application
Running the Application
Deployments
Manual Deployments
Automatic Deployments
Index


📜 SIMILAR VOLUMES


The Definitive Guide to Masonite: Buildi
✍ Christopher Pitt, Joe Mancuso 📂 Library 📅 2020 🏛 Apress 🌐 English

<p>Build fast and effective applications using Masonite, a Python-based framework. This book covers creating a digital home assistant application, but it’s certainly not the only kind of application you could build. By working on this kind of project, you’ll cover the broad range of topics and requi

Web Development with Django: A definitiv
✍ Ben Shaw | Saurabh Badhwar | Chris Guest | Bharath Chandra K S 📂 Library 📅 2023 🏛 Packt Publishing Pvt Ltd 🌐 English

Do you want to develop reliable and secure applications that stand out from the crowd without spending hours on boilerplate code? You've made the right choice trusting the Django framework, and this book will tell you why. Often referred to as a “batteries included” web development framework, Django

Web Development with Django: A definitiv
✍ Ben Shaw, Saurabh Badhwar, Chris Guest, Bharath Chandra K S 📂 Library 📅 2023 🏛 Packt Publishing 🌐 English

Work through realistic case studies to create your own websites easily, securely, and quickly Key Features • Understand Django functionality and the Model-View-Template (MVT) paradigm • Create and iteratively build a book review website, adding features as you build your knowledge • Explore ad

The Definitive Guide to JSF in Java EE 8
✍ Arjan Tijms & Bauke Scholtz [Arjan Tijms] 📂 Library 📅 2018 🏛 Apress 🌐 English

<span><div><div>Learn and master the new features in the JSF 2.3 MVC web framework in this definitive guide written by two of the JavaServer Faces (JSF) specification leads. The authors take you through real-world examples that demonstrate how these new features are used with other APIs in Java EE 8

Flask Web Development with Python: Build
✍ Leire Verdugo 📂 Library 📅 2024 🌐 English

Python is one of the most versatile high-level programming languages ever developed. Rather than having to jump into strict syntax rules, Python reads like English and is simple to understand for someone new to programming. This allows you to obtain a basic knowledge of coding practices without havi

Beginner's Guide to Streamlit with Pytho
✍ Sujay Raghavendra 📂 Library 📅 2022 🏛 Apress 🌐 English

<p><span>This book will teach you the basics of Streamlit, a Python-based application framework used to build interactive dashboards and machine learning web apps. Streamlit reduces development time for web-based application prototypes of data and machine learning models. As you’ll see, Streamlit he