I’m developing a Marino app that is mounted in FastAPI. One of the requirements for this project is that the app needs to have different banners depending on the environment it is deployed. Currently, I’m doing something like:
import marimo as mo
import os
ENV_ID = os.getenv(“ENV_ID”)
app = marimo.App(html_head_file=f"head_{ENV_ID}.html")
It works but the issue is that when in notebook editor mode, on save, marimo will remove the “import os” and ENV_ID set line. Not a blocker, just a bit cumbersome to put it back every time, but I’m wondering if there could be a formal way to support dynamic app configuration such as this.
Perhaps an app factory approach could work? Could specify path to the factory callable in
.marimo.toml
.
I think dynamic configuration would be really powerful for those of us using programmatic Marimo deployments.
I’m currently on marimo 0.10.14