Closed mandyWW closed 1 year ago
There is also some confusion over the mention of FLASK_ENV=development
in the Hints - FLASK_ENV has a specific meaning which is to enable/disable automatic loading of code changes for debugging. It's also deprecated. I think it would be better to use a different environment variable name for this task e.g. RUN_MODE.
I've switched this to use FLASK_DEBUG
which is still used. There's quite a lot of potential complexity here as not only are we currently explicitly hard coding debug=True
in the app.py
, but also there is a --debug
option if the app is launched with the flask
command... which shows how blurry being "in dev" vs. "in production" can be with Flask. For now this is scaled back to just make students aware that environment variables exist, whether or not they choose to use them here.
It is not clear from task-3-env exactly what the student needs to do. It would be preferable to be more specific about the goal and to make this goal something testable.
One suggestion:
index.html
to include a footer with an{{environment}}
variable which displays the server mode e.g. either "running in development mode" or "running in production mode". Ask the student to retrieve the value of the RUN_MODE environment variable inapp.py
and pass it to render_template so the footer displays the correct mode. Although a student could end up "hacking" this by hardcoding a value into the HTML!