Flask App Factory Pattern Cheat Sheet

Create_app factories, extensions, and configs

Last Updated: November 21, 2025

Focus Areas

Focus
Return new app instances per call and inject configs
Register blueprints and CLI commands inside the factory

Commands & Queries

flask --app project run
Start the Flask app
flask shell
Inspect the factory
python -m flask blueprint list
List registered blueprints

Summary

Keep app creation centralized to support testing and extensions.

💡 Pro Tip: Pass configs through `create_app` and initialize extensions per instance.
← Back to Web Frameworks | Browse all categories | View all cheat sheets