Config.toml do not work after deployed

I change the background color in config.toml.
It works just fine locally, however the color does not change after being deployed in

my app repo

Anyone can help? Thanks in advance.

I assume that the streamlit cloud runtime expects the .streamlit/config.toml path in the root folder, but you have it nested in a subfolder, relative to the streamlit app.

  • Running streamlit apps from subfolders cause quite often problems on streamlit cloud, because the paths seems to be wrecked.
  • If you want to address parent folders, it gets even more complicated.
  • I would generally recommend to use only one streamlit project per github repo and always work from the root folder.
1 Like

One thousand thanks. :slight_smile:

Not exactly.

When you deploy from Streamlit Cloud, people assume that a cd mydir happens, because that’s what a lot of people do on local development. This would imply a run command of:

streamlit run

But what Streamlit Cloud always does is starts at the top-level, passing in the entire path that the user puts into the launch window. This implies a run command of:

streamlit run apps/myapp/v2/justkidding/v7/

So when people go from their local environment development to Streamlit Cloud, references like this will break:

with open('file.txt', 'r'):

While one could argue that Streamlit Cloud should be a “do what I mean” system, this is why we suggest that users make their path references using pathlib or similiar package, to programmatically determine where they are in the file tree so that the code is robust across any deployment platform.


1 Like

Thanks for the clarification, Randy. :+1:

Yeah, thats what i meant with “wrecked”, maybe not the right word for it :zipper_mouth_face:

I think most users don’t know this and are wondering, why their paths are not working anymore.

1 Like

how did you solve it? i did not get it. thanks!

Put your it to be your main page of your app) at the root directory.

Thnaks for your answer. Do yo mean to put it at the root directory of github? How can i do that? (now it is inside a default branch called “main”)

Hi Randy, i am still not getting your solution
can you give me some extra information?
do i have to put the file at the root directory of my github? how can i do that?
best and thanks

Hi @pilarpique,
To put at the root directory, you would simply put it in your repository without putting it in a folder.
Hope that helps clarify!

thank you very much caroline! actually my is not in a folder and config.toml is still not working. do you know why this is happening?

Hi @pilarpique, have you tried deleting and re-deploying the app?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.