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
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.