Flask, CherryPy and static content Flask, CherryPy and static content flask flask

Flask, CherryPy and static content


Here is a snippet that should do what you are asking for. This is based on the set of instructions provided here (it's definitely worth a read, though I'm not sure how up to date it is).

import cherrypyfrom hello import appcherrypy.tree.graft(app, '/')cherrypy.tree.mount(None, '/static', {'/' : {    'tools.staticdir.dir': app.static_folder,    'tools.staticdir.on': True,    }})cherrypy.config.update({    'server.socket_port': 8080,    })cherrypy.engine.start()cherrypy.engine.block()