šŸ“£ Introducing Dash `/pages` - A Dash 2.x Feature Preview

Hi @davegibbon_yvr

Yes, you can use query strings. For a minimal example see multi-page demo app #10

We do it this way in the Dash Example Index. For example this link will show all the apps with RadioItems in the code

https://dash-example-index.herokuapp.com/?code=RadioItems

Hereā€™s the code:

@AnnMarieW

Hi Ann, by using page register feature, I assume it is not possible to import defined variables from another pages? My project current folder is like this:
-app

  • db.py
  • pages
    |-- home.py
    -chapter1
    |-- page1.py
    |-- page2.py
    -chapter2
    -chapter3
    |-- page1.py
    |-- page2.py

I have defined some complex function in page 1.py under chapter 3, and would like to use this function again in page2.py under chapter 1. So I use from pages.chapter3.page1 import function1. But it gives me some error saying ā€œException: modules [ā€˜app.pages.chapter1.page1ā€™, ā€˜pages.chapter1.page1ā€™] have duplicate pathsā€

the siutation I had is very similar to python - Duplicate paths issue - Stack Overflow milieereā€™s question. however I am not using Jupyter notebook or any notebooks. Do you have any suggestion to solve this error?

Hello @hwang,

For this, Iā€™d recommend bringing your functions into a utils folder and then import them into the pages that you want to use them. :slight_smile:

I also have some aggregated df and columndef for Dash grid inside of the pages, so it will be better if I can deploy them directly.

I can use dcc.store to store aggregated dataframe but for defined columdef, are there any ways to callback in different files?

You can always make your function to be able to return the df configured however you want it to be. Or whatever function for that matter.