How can you use environment variables with Flask?

How can you use environment variables with Flask?

a) By using os.environ
b) By using request.args
c) By using request.env
d) By using config.env

Answer:

a) By using os.environ

Explanation:

In Flask, you can use the Python os.environ module to access and work with environment variables.

Reference:

Flask Quiz – MCQ Questions and Answers

Scroll to Top