How do you create and use a Flask extension?
Instruction: Describe the process of creating and integrating a custom Flask extension into an application.
Context: This question evaluates the candidate's ability to extend the functionality of Flask applications through custom extensions.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
A Flask extension is usually an ordinary Python object/package with an init_app method. It does not need to subclass Flask or Blueprint. Modern packaging can use pyproject.toml; setup.py is not inherently required.
This Flask3.1 extension adds a configured public build label to responses:...