sys.flags.dev_mode is True, when running as python -X dev app.py
sys.flags.dev_mode
python -X dev app.py