Streamlit Webapp Config
Hi,
I am using Streamlit under Code Studio in Dataiku version 14.3. The theme changes I make in code_studio-versioned/streamlit/.streamlit/config.toml do not reflect in the interface. However if I edit the /home/dataiku/.streamlit/config.toml file (which I understand is the global config) with vi and change the theme settings (for example, [theme] primaryColor = "#5c77f0ff"), the changes do appear in the interface. But this setting is not persistent and does not remain when I publish the app as a webapp. Is there an alternative method to modify (persistently) the Streamlit config?
Thanks in advance.
Best Answer
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023, Circle Member Posts: 2,667 Neuronstreamlit applications are now supported as standard webapps (ie outside code studios). Might be worth trying there.
Answers
-
-
Hey Mod,
The easiest way to persistently apply a theme to a published Streamlit webapp is to define the settings as "Environment Variables" within the webapp's settings tab, using the prefix
STREAMLIT_THEME_.
Here is a list of the specific setting names for reference:Config Option
Environment Variable
primary Color
STREAMLIT_THEME_PRIMARY_COLOR
Background Color
STREAMLIT_THEME_BACKGROUND_COLOR
Secondary Background Color
STREAMLIT_THEME_SECONDARY_BACKGROUND_COLOR
Text Color
STREAMLIT_THEME_TEXT_COLOR
Font
STREAMLIT_THEME_FONT
While editing the global config in Code Studio works temporarily, those changes are ephemeral; for a file-based approach to persist, you must ensure the
.streamlit/config.tomlis located in the root of your webapp folder and that you have manually triggered a "Sync files with DSS" before publishing.If the file-based configuration is still being ignored due to launch-directory conflicts, using "Environment Variables" is the best method. For administrators, these can also be baked into the "Code Studio Template" via an
Append to Dockerfileblock using theENVcommand. This effectively bypasses filesystem isolation and ensures your branding remains intact regardless of how the container is deployed or restarted. -
Hi,
Why don't you use: ? It doesn't work?
There are also a bunch of things that may help you on this page:
If none of these solutions work for you, I would go with the solution "Append to Dockerfile"
Best
-
I saw the update but have never tried and didn't know that webapp has the config.toml inside. Solved with migrating from CS to webapp. Thanks!
-
Before the Streamlit webapp update we published our all Streamlit UI's using CodeStudio. Didn't know that I can configure config.toml in Webapp. Using Streamlit webapp solved my problem thanks.
