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 file I’m using for my Heroku app. Here is that code:

mkdir -p ~/.streamlit/

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

I don’t know what this file does, I just copied it from the Data Professor tutorial I followed. My Procfile (for Heroku) only says web: sh && streamlit run 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 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 be run to configure the app env and then run your file. Here’s an example of how it might look:

web: sh && streamlit run

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

- my_awesome_app/
  - Procfile
  - requirements.txt
  - .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 && streamlit run

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: