Black Lives Matter. Please consider donating to Black Girls Code today.

Multipage app demo broken

I’m running the demo from (bottom part of the page “Structuring a Multi-Page App”) and notice that the following code from is not executing when I change the dropdown value.

    Output('app-1-display-value', 'children'),
    [Input('app-1-dropdown', 'value')])
def display_value(value):
    return 'You have selected "{}"'.format(value)

When I move the method from into it runs fine.

Not sure what the problem is as I’m using the sample code with no change.

I’m using:


I found a workaround to the problem. Think this a dash bug that doesn’t find all @app.callback functions when importing the dash app object from a fully qualified python path.

While loading the demo files into my IDE (eclipse or pycharm), and were complaining while importing app. I therefore changed the imports to fully qualified python paths. After this, dash was not finding the callbacks embedded within app1 and app2. Reverting back to the demo imports solved this.

This is my project structure:

   |- multi_app
   |      |- apps
   |      |      |-
   |      |      |-
   |      |-
   |      |-

This was my import in and so the IDE wouldn’t complain:

from import app

instead of the one from the demo file:

from app import app

Thanks for reporting @bkelemen! Oddly, the app structure in the docs works for me (in both python2 and 3).

Where are you calling this function? The intended usage is that you call it inside the multi_app folder:

$ ls 

$ python
 * Running on (Press CTRL+C to quit)

I can’t get it to work either, it returns a 404 even though I changed the else: from ‘404’ to “You’re lost”. I spent most the day trying to get my original projects ported over to a multipage app and now I’m thinking something else is going on. I recently updated the libraries, perhaps I should revert to the ones listed on the example page?

edit: I realized I had a server running (from a poorly killed attempt) that was blocking the port, I found the process killed it and now everything works fine. Even my own app!

1 Like

Hi Chris,

This is weirded. I can only reproduce the issue from within the IDE when running I believe this has something to do with the PYTHONPATH the IDE is setting. As this is not blocking me anymore, I wouldn’t spend too much time on it.

Just for refrerence for the future, this is what I did: I left as-is and modified only by replacing:

from app import app


from import app

This makes the IDE happy in while still highlighting a compile error in the import of When running the app no error is displayed in the console, but the callback in app1 is not being executed (and therefore the text “You have selected …” doesn’t appear). This continues to work fine in app2 with the original untouched import.

Also, when running this demo from the command prompt I get this error:

$ python
Traceback (most recent call last):
  File "", line 7, in <module>
    from apps import app1, app2
  File "/Users/XXXXXX/Python Workspace/dash_test/multi_app/apps/", line 5, in <module>
    from import app
ImportError: No module named

you have to append “/apps/app1” to the url to get it to run