fohrloop / dash-uploader

The alternative upload component for python Dash applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multi page issue

omarirfa opened this issue · comments

Hi,

I recently started using dash-uploader and was wondering if there is multi page support since I could not find an example. All the current examples require the app to be initialized using the command below for the du.configure_upload and has to be located in the same file where dash-uploader is used.

Command to initialize du.configure_upload:
app = Dash(__name__, suppress_callback_exceptions=True, external_stylesheets=[dbc.themes.BOOTSTRAP])

Heres my code below:

# app = Dash(__name__, suppress_callback_exceptions=True, external_stylesheets=[dbc.themes.BOOTSTRAP])
dash.register_page(__name__, styles=dbc.themes.BOOTSTRAP)
UPLOAD_FOLDER = r"D:/AzureDevOps/saltr/csv_feature/temporary_folder"
du.configure_upload(app, UPLOAD_FOLDER)

I was wondering if there is another way to use du.configure_upload with dash.register_page instead of using dash.Dash since we have this registered somewhere else in the code?

May be you can use dash.get_app() in page to get app instance.

ref: https://dash.plotly.com/urls#circular-imports
In cases where you need access to the app in one of your page layouts, you can access it with dash.get_app.

Thanks that solved the issue!