[Python] Plotly Dash App on Kubernetes -- Not loading Javascript

Discussão em 'Python' iniciado por Stack, Dezembro 7, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to run Dash app using Flask on my server with Kubernates

    import dash
    import dash_html_components as html
    from flask import Flask

    server = Flask(__name__)
    app = dash.Dash(name='my-server', server=server)

    app.layout = html.Div([
    ....
    ])


    @server.route("/")
    def dash_app():
    return app.index()


    if __name__ == '__main__':
    server.run(host='0.0.0.0')


    Obviously have more stuff(like more html and callback functions). When create a docker image and run it locally, it runs perfectly fine at 127.0.0.1:5000, though when I push it to my server and run it with kubernates, it gives me the following errors.

    Refused to execute script from '<URL>' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.


    And

    Uncaught ReferenceError: DashRenderer is not defined


    And stuck with "Loading..." screen.

    Any help/insight would be appreciated! Thanks :)))

    Continue reading...

Compartilhe esta Página