[Feature]: Make Flask debug mode configurable via environment variable
What problem does this solve?
app.py currently ends with app.run(debug=True). The comment above it says never to
run with debug=True in production, but nothing enforces that. If someone runs
python app.py on a server, the Werkzeug debugger is exposed, and its interactive
console allows remote code execution.
Proposed solution
Read the flag from the environment, so the safe behavior is the default:
import os
app.run(debug=os.environ.get("FLASK_DEBUG") == "1")
Local development stays one command away (set FLASK_DEBUG=1 on Windows,
export FLASK_DEBUG=1 on Linux/macOS). I'd also add one line about this to the
Quick Start section of the README.
Alternatives considered
Running the app via flask run --debug instead of python app.py. That also keeps
debug off by default, but changes the documented startup command.
Which part of the app does this affect?
Homepage and form
Estimated complexity
Small (a few lines of CSS or JS)
Before submitting
- [x] I searched existing issues and this has not been requested before.
- [x] This change would benefit contributors beyond my own use case.
Thank you for opening your first issue in DevPath.
Please make sure to:
- Read CONTRIBUTING.md
- Wait for assignment before starting work
- Follow repository guidelines carefully
- Keep discussions constructive and on-topic
Happy contributing.
@Maksimuson Assigned...Start working on the pull request