App Context vs Request Context
Two contexts and what lives in each.
Two Kinds of Context
Flask runs your code inside a context, a temporary bubble holding the data your view needs. There are two flavors: an app context and a request context.
The App Context
The application context tracks which app is active right now. It exists whenever Flask is doing work, even outside a real web request.
All lessons in this course
- App Context vs Request Context
- current_app and the g Object
- Context Locals and Thread Safety
- Push a Context in Scripts and Shells