flask之全局对象

from flask import current_app, g

g is a special object that is unique for each request. It is used to store data that might be accessed by multiple functions during the request.
The connection is stored and reused instead of creating a new connection if get_db is called a second time in the same request

current_app
is another special object that points to the Flask application handling the request. 


原文地址:https://www.cnblogs.com/zxpo/p/9651159.html