My data are also located in a folder (data) at the same level than “streamlit_app”.
My local app is running well…
When I want to upload it in the cloud, I define the repository, the branch, the Main file path (streamlit_app/app.py), and the url.
The problem is that the app does find my assets files (images files in the folder “assets”), or the file style.css located in the folder “streamlit_app”.
To make a long story short, it seems that the app on the cloud considers that the default path is not “streamlit_app”.
How can I set this path , so the same program run as well locally and in the cloud ?
Thank you
@Olivier_Renouard
It’s generally a good practice to keep the app.py (main streamlit app) at the root of the repository instead of putting inside a folder, unlike other pages/tabs and data… etc, e.g:
GitHub repo root
└──
├── > data
│ └── # your data
├── > assets
│ └── # assets and styling files
├── > tabs
│ └── # your different streamlit pages
├── .gitignore
├── README.md
├── config.py
├── member.py
├── requirements.txt
└── app.py
I can’t try things out right now but I suggest you try my previous solution jsut to see the app actually deploys fine with that files setup. You can deploy a test branch in which you have the app.py at root (I reckon you’ll have to relink your data for this testing).
Or try this (from the top of my head) have a main.py at root of the folder, in which it calls the app.py from streamlit_app/app.py and run the streamlit main function. This could work, try it out from a separate branch as well and let me know your results on both suggested solutions.
@Olivier_Renouard Sure, do you have a link to your GitHub repo I might push a Pull Request or if it’s private I’ll have to build and deploy a demo app or just quick code sample indications, you pick.
Thank you very much for your help IndigoWizard.
Your solution is more elegant as you don’t need to modify the app.my code.
I will test it later.
Again thank you