Trying to deploy a Flask app on CherryPy server Trying to deploy a Flask app on CherryPy server flask flask

Trying to deploy a Flask app on CherryPy server


Cheroot (src) is a low-level HTTP and WSGI server, which used to be a part of CherryPy (src) once, but has been factored out into a separate repo a while back. So former cherrypy.wsgiserver has moved to cheroot.wsgi module.

It's completely replaceable and designed to allow developers to depend on Cheroot directly if they only use WSGI server, not requiring other parts of CherryPy.

So here's how you can use it in a version-agnostic way:

try:    from cheroot.wsgi import Server as WSGIServer, PathInfoDispatcherexcept ImportError:    from cherrypy.wsgiserver import CherryPyWSGIServer as WSGIServer, WSGIPathInfoDispatcher as PathInfoDispatcherfrom hello import appd = PathInfoDispatcher({'/': app})server = WSGIServer(('0.0.0.0', 80), d)if __name__ == '__main__':   try:      server.start()   except KeyboardInterrupt:      server.stop()