liveBook · Manning

Config.toml

As explained in Build Python Web Apps with Streamlit

config.toml is a TOML-formatted Streamlit configuration file containing application settings.

Use config.toml to keep Streamlit application settings in a dedicated TOML file instead of repeating command-line options when starting the app. section 12.2.3

Create the file inside the .streamlit folder. Configuration can control details such as logging, theme colors, and other Streamlit server behavior. section 12.2.3

Enable detailed logging

To make startup messages more detailed, create .streamlit/config.toml with this content: [logger] level = "debug" This has the same purpose as setting STREAMLIT_LOGGER_LEVEL=debug or passing --logger.level debug to streamlit run. section 12.2.3

Choose the configuration method that fits the way you run the app:

  • Use environment variables beginning with STREAMLIT_ when deployment settings are supplied by the runtime. section 12.2.3
  • Use .streamlit/config.toml when settings belong with the application’s project files. section 12.2.3
  • Use flags with streamlit run for a setting that should apply to one command invocation. section 12.2.3
  • Run streamlit config show to inspect the available configuration options before choosing a setting. section 12.2.3

How Build Python Web Apps with Streamlit covers it

How deep it goes
Defines the file location, shows one TOML setting, and contrasts it with environment variables and command-line flags.
Examples
Uses .streamlit/config.toml to set the logger level to debug.
What it assumes
Assumes a Streamlit app and basic terminal use, while introducing the configuration file location and TOML example.
What you can do after
Operate Streamlit by configuring logging through a .streamlit/config.toml file or equivalent runtime options.
How it connects
Connects Streamlit configuration with environment variables, command-line flags, logging, and deployment.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.