Describe how to configure a Flask application.
Instruction: Explain different methods to configure a Flask application for development and production environments.
Context: The goal is to understand the candidate's knowledge of Flask configuration patterns, including environment-specific configurations.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Load configuration before initializing extensions or serving requests. Flask supports mappings, Python objects/files and prefixed environment variables; choose a documented precedence so the effective settings are predictable.
This Flask3.1 example deliberately requires a recognized mode and supplied secret:...