Context Management of flask

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.