Disable dash instance created before running dash project on dataiku

Level 1
Disable dash instance created before running dash project on dataiku


I have developped a dash web-app using Dash packag, and it works well locally. However, once I have uploaded it to Dataiku, it is not working as expected. 

My question is: how should I remove the "app = dash.Dash(...)" instance defined in dataiku? Is there a way to disable it and enable the dash instance declared in my codes? 

Here is how our project structure looks like: 


├── app.py
├── dashboard/
│   ├── assets/
│   │   └── Icon.svg
│   ├── content.py
│   ├── index.py
│   └── layout/
│       ├── callbacks/
│       │   └── displayPageCallbacks.py
│       └── dataUpload.py
├── environment.yml
├── Procfile
└── README.md



In the `index.py` file, there is an dash instance created already: 


# index.py
from dash import Dash
import dash_bootstrap_components as dbc

external_stylesheets = [dbc.themes.BOOTSTRAP]
app = Dash(
app_title = "My Project"
app.title = app_title


 and this instance will be called for each other elements to compose our dashboard, for example "@app.callbacks(...)" in the other files. 

Locally, we just need to run the `app.py` file:


# app.py
from dashboard.content import app

server = app.server
if __name__ == "__main__":


 which will call the app from the content.py with "app.layout" defined there:


# content.py
from dashboard.index import app
from dashboard.layout.callbacks import displayPageCallbacks
from dash import html, dcc, Input, Output
import dash_bootstrap_components as dbc

navbar = dbc.NavbarSimple(
        dbc.NavItem(dbc.NavLink("Home", href="/")),
        dbc.NavItem(dbc.NavLink("Data upload", href="/data_upload")),
    brand="My Project",

app.layout = html.Div(
        dcc.Location(id="url", refresh=False),
        dbc.Container(id="page-content", className="mb-4", fluid=True),



Best regards, 

Operating system used: Windows 10



0 Kudos
1 Reply

While I don't have the answer to your question I would recommend a different approach. Start by creating the Dash app on this Tutorial and verify that's working as per the example. Then slowly start to modify it adding the code from your external App. By following this process you will be able to see what changes cause the Webapp to fail in Dataiku and take corrective action.

0 Kudos


Labels (2)
A banner prompting to get Dataiku