Custom theme (.streamlit/config.toml) will not update when I run code

I’m trying to add custom themes to my Heroku app. It might have to do with my setup.sh file I’m using for my Heroku app. Here is that code:

mkdir -p ~/.streamlit/

echo "\
[server]\n\
port = $PORT\n\
enableCORS = false\n\
headless = true\n\
\n\
" > ~/.streamlit/config.toml

I don’t know what this setup.sh file does, I just copied it from the Data Professor tutorial I followed. My Procfile (for Heroku) only says web: sh setup.sh && streamlit run main.py and does not include anything about .streamlit. That might also be an issue. I just have a feeling that Heroku isn’t reading the config.toml. I you know anything about this please lmk. :wink:

Hi @xavi,

Thanks for posting and welcome to the Streamlit Community forum!

The setup.sh file contents you’ve posted above look okay. The file creates a directory at ~/.steramlit/ as specified by the first line of code and writes a config file config.toml to the directory created by line 1.

Do you have a Procfile setup in your root directory? Procfile specifies that setup.sh be run to configure the app env and then run your streamlit_app.py file. Here’s an example of how it might look:

web: sh setup.sh && streamlit run streamlit_app.py

This is how an example of how the directories might look for your app:

- my_awesome_app/
  - streamlit_app.py
  - Procfile
  - requirements.txt
  - setup.sh
  - .streamlit/
    - config.toml

Let me know if this works.

Happy Streamlit-ing! :balloon:

Here is my directory. I hope it looks fine :sweat_smile:

Thank you @tonykip for the quick response. Please lmk if this looks okay. btw my Procfile contains exactly what it should (web: sh setup.sh && streamlit run main.py)

Looks good! Does it work as you need it to?

No. I tried to change the color and I got this error when it updated. :confused:

Can you lmk what this means?

Can you share a screen recording or describe how you’re getting to this error?

Sure here is a screen recording.
Its Discord CDN I hope that works :sweat_smile:

Hi @xavi :wave:

It looks like you’re trying to change the contents of config.toml while the app is running.

If changes to .streamlit/config.toml are made while the app is running, the server needs to be restarted for changes to be reflected in the app.

1 Like

Hello @snehankekre @tonykip!

I tried heroku restart after I pushed my Github changes, it did restart but when I checked the website… nothing happened! I’m not too sure why. Do I need to completely stop the Heroku app and turn it back on when I think the changes save? Remember its not being hosted via my computer locally.

Thank you for replying.

Hey :wave: @tonykip and @snehankekre
I’m reaching out again because I am still experiencing issue I you could take a look at the last message I sent that would be greatly appreciated.

When I try to make any changes to my code I get this :anger:

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