I have a multi-page application that utilizes data imported from a mongoDB. Home page has the ability to view, filter, sort, and update the data in a dash datatable format. The report page allows the user to enter inputs in order to add a new entry to the dataframe/datatable. I am using dcc.Store with session storage in the app.py file to share the data between pages/callbacks.
The issue I am having is that in order to make my application suitable for deployment, the initialization function that downloads the data from mongoDB must be contained within a callback on the home page. This leads to the initialization function being called every time the home page is navigated to, essentially clearing any data updates done within the app by redownloading the database data.
I need a way to download the data only once on app startup, but update that data saved on the dcc.Store component from different pages of the application.