Theme with st.set_page_config doesn't change after deployed

Hello,
i deployed ma streamlit app on cloud with github but when i try to change theme (like backgroundcolor) with my file .streamlit/config.toml it doesn’t work.

I was looking for a solution but didn’t find an answer that works.
I let my code below.

My file .streamlit/config.toml:

[theme]
backgroundColor="#fffffe"
secondaryBackgroundColor="#fddc70"

My code in main_page.py

# Charger les configurations de thème à partir du fichier config.toml
config_data = toml.load(".streamlit/config.toml")

# # Appliquer les configurations de thème
theme_config = config_data.get("theme", {})
try:
    st.set_page_config(
    page_title="projet RPG - Eric Lachard",
    page_icon=":memo:",
    layout="centered",
    initial_sidebar_state="expanded",
    **theme_config
        )    
except Exception as e:
    st.markdown(f"Erreur: {e}")

I precise ce error message is about theme option’s name doesn’t fit with set_page_config.

Thank you

Indeed, st.set_page_config does not expect any theming configuration. There should be no need to read the config.toml file from the Python script, as explained in Theming - Streamlit Docs. Perhaps rebooting the app will apply the changes in the toml configuration file?

Hi edssac.
i found the solution.
In fact the probleme comes from the .streamlit/config.tom file.

i put space before and after ‘=’ and after that it’s working when i go in setting.

Thanx for the help

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