Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Structuring a Multi-Page App: Can't import individual apps

Hi, I am trying to combine single Dash Apps into a multipage application in Python. Firstly I am trying to replicate the sample code found in the documentation.

But the following code line inside the index.py file causes an error:

from apps import app1, app2

Here is the screenshot:

These are the relevant files modeled after the documentation.
Bildschirmfoto 2020-09-01 um 16.53.29

Does anyone know what I have to change to make it work?
Thank you very much.

What directory are you in when you start the program? apps or multipage?

try importing the os library and then print os.getcwdb().

If the directory is multipage, your apps command for importing app1 and app2 is incorrect.

1 Like

Hi @PBK, thank you for your suggestion. I already made sure to set the working directory. I switched to the following template: https://github.com/conquistadorjd/dash-02-boilerplate. PyCharm still labels the individual Apps as unresolved reference but the App works fine. Seems to be more a PyCharm thing.
Have a nice day.