Attached is the patch to use https://pypi.org/project/cheroot/ instead of current flask dev server. cheroot is a stable production ready server. Plus, flask dev server is not recommended for production.
Code is changed to use cheroot only when DEBUG is False, otherwise you the default flask server.