Skip to content

Blueprint before_app_first_request vs record_once usage discrepancy #5166

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

You must be logged in to vote

See the documentation for record_once and record: https://flask.palletsprojects.com/en/2.3.x/api/#flask.Blueprint.record. The decorated function takes a state argument.

@blueprint.record_once
def my_test_function(state):
    state.app.logger.info("testing")

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by TheDavidFactor
Comment options

You must be logged in to vote
0 replies
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
Converted from issue

This discussion was converted from issue #5165 on June 15, 2023 16:42.