Dash Project Structure - modules outside the main project folder

Hi,

My dash app runs well locally, but having issues deploying it to Dash Enterprise.

I’ve followed the recommended project structure in docs, except I have some modules outside of the dash project folder which my visualisations depend on;

src/
dash_project/

  • visualisations.py
  • app.py
  • requirements.txt
  • Procfile

models/

  • my_model.py

In visualisations.py, I import my model code using an absolute path;

visualisations.py

from src.models.my_model import modelFramework

The problem is the path from src isn’t recognized when deploying the dash_project folder to dash enterprise.
Things I’ve tried:

  • Include the model folder within dash_project. This works, but is not a logical way to organise my repo.
  • Instead of only copying the contents of dash_project, copy the entire src folder into dash server. This fails because the project root (/src) doesn’t contain the Procfile.
  • Move Procfile, app.py and requirements.txt to src folder and copy entire src folder into dash server. This doesn’t throw any errors in the deployment pipeline, but my app isn’t updated with the latest changes (even though git diff picks up the correct changes before pushing)

Is there a way to successfully deploy the app with my initial intended layout?

In the end I gave in and just placed the models folder inside dash_project.
Have to work within the framework given.