From 2ab39f879de40e52973432a98b7b11d4eacf785d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Sun, 27 Feb 2022 14:16:33 +0200 Subject: [PATCH] Add `DEBUG` environment variable to toggle Sanic debugging --- camdetect.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camdetect.py b/camdetect.py index 414c594..25b92ed 100755 --- a/camdetect.py +++ b/camdetect.py @@ -481,6 +481,8 @@ async def setup_db(app, loop): monitor(app).expose_endpoint() try: - app.run(host="0.0.0.0", port=5000) + app.run(host="0.0.0.0", + port=5000, + debug=bool(os.getenv("DEBUG", 0))) except KeyboardInterrupt: asyncio.get_event_loop().close()