Please enable JavaScript.
Coggle requires JavaScript to display documents.
Flask, User's Guide, Additional Notes - Coggle Diagram
Flask
User's Guide
Patterns for Flask
Large Applications as Packages
Simple Packages
Working with Blueprints
Application Factories
Basic Factories
Factories & Extensions
Using Applications
Factory Improvements
Application Dispatching
Working with this Document
Combining Applications
Dispatch by Subdomain
Dispatch by Path
Using URL Processors
Internationalized Application URLs
Internationalized Blueprint URLs
Deploying with Setuptools
Basic Setup Script
Tagging Builds
Distributing Resources
Declaring Dependencies
Installing / Developing
Deploying with Fabric
Creating the first Fabfile
Running Fabfiles
The WSGI File
The Configuration File
First Deployment
Next Steps
Using SQLite 3 with Flask
Connect on Demand
Easy Querying
Initial Schemas
SQLAlchemy in Flask
Flask-SQLAlchemy Extension
Declarative
Manual Object Relational Mapping
SQL Abstraction Layer
Uploading Files
A Gentle Introduction
Improving Uploads
Upload Progress Bars
An Easier Solution
Caching
View Decorators
Login Required Decorator
Caching Decorator
Templating Decorator
Endpoint Decorator
Form Validation with WTForms
The Forms
In the View
Forms in Templates
Template Inheritance
Base Template
Child Template
Message Flashing
Simple Flashing
Flashing With Categories
Filtering Flash Messages
AJAX with jQuery
Loading jQuery
Where is My Site?
JSON View Functions
The HTML
Lazily Loading Views
Converting to Centralized URL Map
Loading Late
MongoDB with MongoEngine
Configuration
Mapping Documents
Creating Data
Queries
Documentation
Adding a favicon
See also
Streaming Contents
Basic Usage
Streaming from Templates
Streaming with Context
Deferred Request Callbacks
Adding HTTP Method Overrides
Request Content Checksums
Celery Background Tasks
Install
Configure
An example task
Run a worker
Subclassing Flask
Single-Page Applications
Quickstart
A Minimal Application
What to do if the Server does not Start
Debug Mode
HTML Escaping
Routing
Static Files
Rendering Templates
Accessing Request Data
Redirects and Errors
About Responses
Sessions
Message Flashing
Logging
Hooking in WSGI Middleware
Using Flask Extensions
Deploying to a Web Server
Tutorial
Project Layout
Application Setup
Define and Access the Database
Blueprints and Views
Templates
Static Files
Blog Blueprint
Make the Project Installable
Test Coverage
Deploy to Production
Keep Developing!
Testing Flask Applications
The Application
The Testing Skeleton
The First Test
Logging In and Out
Test Adding Messages
Other Testing Tricks
Faking Resources and Context
Keeping the Context Around
Accessing and Modifying Sessions
Testing JSON APIs
Testing CLI Commands
Command Line Interface
Application Discovery
Run the Development Server
Open a Shell
Environments
Debug Mode
Environment Variables From dotenv
Environment Variables From virtualenv
Custom Commands
Plugins
Custom Scripts
PyCharm Integration
Configuration Handling
Configuration Basics
Environment and Debug Features
Builtin Configuration Values
Configuring from Python Files
Configuring from Data Files
Configuring from Environment Variables
Configuration Best Practices
Development / Production
Instance Folders
Modular Applications with Blueprints
Why Blueprints?
The Concept of Blueprints
My First Blueprint
Registering Blueprints
Nesting Blueprints
Blueprint Resources
Building URLs
Blueprint Error Handlers
Handling Application Errors
Error Logging Tools
Error Handlers
Custom Error Pages
Blueprint Error Handlers
Returning API Errors as JSON
Logging
Debugging
The Request Context
Purpose of the Context
Lifetime of the Context
Manually Push a Context
How the Context Works
Callbacks and Errors
Context Preservation on Error
Notes On Proxies
Becoming Big
Read the Source.
Hook. Extend.
Subclass.
Wrap with middleware.
Fork.
Scale like a pro.
Discuss with the community.
Signals
Subscribing to Signals
Creating Signals
Sending Signals
Signals and Flask’s Request Context
Decorator Based Signal Subscriptions
Core Signals
Templates
Jinja Setup
Standard Context
Controlling Autoescaping
Registering Filters
Context Processors
Pluggable Views
Basic Principle
Method Hints
Method Based Dispatching
Decorating Views
Method Views for APIs
The Application Context
Purpose of the Context
Lifetime of the Context
Manually Push a Context
Storing Data
Events and Signals
Using async and await
Performance
Background tasks
When to use Quart instead
Extensions
Other event loops
Installation
Python Version
Dependencies
Virtual environments
Install Flask
Logging
Basic Configuration
Email Errors to Admins
Injecting Request Information
Other Libraries
Working with the Shell
Command Line Interface
Creating a Request Context
Firing Before/After Request
Further Improving the Shell Experience
Foreword
What does “micro” mean?
Configuration and Conventions
Growing with Flask
Debugging Application Errors
In Production
The Built-In Debugger
External Debuggers
Extensions
Finding Extensions
Using Extensions
Building Extensions
Foreword for Experienced Programmers
Thread-Locals in Flask
Develop for the Web with Caution
Development Server
Command Line
In Code
Deployment Options
Hosted options
Self-hosted options
Standalone WSGI Containers
Gunicorn
uWSGI
Gevent
Twisted Web
Proxy Setups
uWSGI
Starting your app with uwsgi
Configuring nginx
mod_wsgi (Apache)
Installing mod_wsgi
Creating a .wsgi file
Configuring Apache
Troubleshooting
Support for Automatic Reloading
Working with Virtual Environments
FastCGI
Creating a .fcgi file
Configuring Apache
Configuring lighttpd
Configuring nginx
Running FastCGI Processes
Debugging
CGI
Creating a .cgi file
Server Setup
ASGI
Additional Notes
Design Decisions in Flask
The Explicit Application Object
The Routing System
One Template Engine
Micro with Dependencies
Thread Locals
Async/await and ASGI support
What Flask is, What Flask is Not
Flask Extension Development
Anatomy of an Extension
“Hello Flaskext!”
Initializing Extensions
The Extension Code
Using _app_ctx_stack
Learn from Others
Approved Extensions
HTML/XHTML FAQ
History of XHTML
History of HTML5
HTML versus XHTML
What does “strict” mean?
New technologies in HTML5
What should be used?
Security Considerations
Cross-Site Scripting (XSS)
Cross-Site Request Forgery (CSRF)
JSON Security
Security Headers
Copy/Paste to Terminal
How to contribute to Flask
Support questions
Reporting issues
Submitting patches
License
BSD-3-Clause Source License
Artwork License
Changes