What is the g object in this flag?
1 answer
g
is an object provided by Flask. It is a global namespace for storing any data that you want to use during a single application context.
from flask import g
Application context lasts one request / response cycle, g
not suitable for storing data across requests. Use database, redis, session or other external data source to persist data.
Note that the dev server and any webserver are already giving out sync information in the logs. If you really want to profile your code, you can use the Werkzeug Application Profiler .
+11
source to share