How can you configure a Flask application to use an external configuration file?
- a. Define configuration settings directly in your Flask app's main Python file.
- b. Create a separate Python module with configuration settings and import it into your Flask app.
- c. Use environment variables for configuration.
- d. Flask doesn't support external configuration files.
You can configure a Flask application to use an external configuration file by creating a separate Python module with configuration settings and importing it into your Flask app. This allows for better separation of concerns and easier configuration management. Options a, c, and d are not recommended practices.
Loading...
Related Quiz
- In which scenarios is it most appropriate to use a metaclass instead of a class?
- The algorithm that follows the 'divide and conquer' strategy is ____.
- What keyword is used in Python to make a decision?
- How can you implement a custom layer in a neural network using TensorFlow or PyTorch?
- If you have a function named fun inside a module named mod, how can you import it directly?