Integrating dash in cherrypy


Is there anyway to integrate a Dash app using cherrypy instead of Flask?

Here is my code:

import dash
import cherrypy
import dash_core_components as dcc
import dash_html_components as html

appl= dash.Dash(__name__, external_stylesheets=external_stylesheets)


class Root(object):

    def index(self):
        "Access the <a href="dash">application</a>"
        return output

    def dash(self):
        return appl

if __name__ == '__main__':  
    configfile=os.path.join(os.path.dirname(__file__), 'server.conf')
    cherrypy.quickstart(Root(), script_name='/', config=configfile)

I get the error:
TypeError: ‘Dash’ object is not iterable

I think I’m very close, but I have the feeling that there is one missing piece

Thank you!

Hi @pablomarina, maybe you mean how to use cherrypy wsgi/cheroot with Dash?

For more info, you can check this out: DASH Deployment: HELP!

Yeah, it was that. Fortunately I finally worked it out during this time.

Thanks for replying anyway.

@pablomarina Can you explain what got it working?

Just using Cheroot function, specifying IP direction or hostname, port number and number of threads. No need to use Cherrypy framework, could be another one (e.g. flask)

1 Like

@pablomarina Hi just did, works well, although no reload function when developing.