Complete the code to run a Flask app in development mode.
if __name__ == '__main__': app.run(debug=[1])
Setting debug=True runs the Flask app in development mode with helpful error messages and auto-reload.
Complete the code to import the production-ready WSGI server.
from [1] import WSGIServer
gevent.pywsgi provides a production-ready WSGI server for Flask apps.
Fix the error in the production server start command.
http_server = WSGIServer(('0.0.0.0', [1]), app) http_server.serve_forever()
The port number must be an integer, not a string, so use 5000 without quotes.
Fill both blanks to create a dictionary comprehension filtering environment variables.
prod_env = {key: value for key, value in [1].items() if key.[2]('PROD_')}Use os.environ to access environment variables and startswith to filter keys starting with 'PROD_'.
Fill all three blanks to configure Flask app for production.
app.config['DEBUG'] = [1] app.config['TESTING'] = [2] app.config['ENV'] = '[3]'
In production, DEBUG and TESTING should be False, and ENV set to 'production'.
