Skip to content

Clarify semantics of app context #5507

Answered by davidism
wwwillchen asked this question in Q&A
Discussion options

You must be logged in to vote

This makes it sound like g is suitable as I'm trying to store information about the current request.

g is the appropriate place to store per-request data. For extensions, we recommend using a prefix like _extension_name_ as a namespace to avoid any potential name conflicts. See https://flask.palletsprojects.com/en/3.0.x/extensiondev/ and specifically https://flask.palletsprojects.com/en/3.0.x/extensiondev/#data-during-a-request for extension dev docs about this.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@davidism
Comment options

@wwwillchen
Comment options

Answer selected by wwwillchen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants