In a nutshell, Falsk context management can be divided into three phases:
1, request to come in, the request of the soles of the relevant data into the context management for management
2, in the View function, to go to the context management to take the value
3. After the request response, the data in the context management should be purged
In more detail:
1, the request just came in, the request,session encapsulated in the RequestContext class, app,g encapsulated in the Appcontext class, and put RequestContext and appcontext into the local class via Localstack
2, the view function, through the localproxy---> Partial function--->localstack--->local value
3, the request corresponding, the first execution save.session () and then the respective execution pop (), the local data purged
Context Management Flowchart:
Context Management of flask