How to set the default page in multipage app? (I don’t want to use main/welcome page)
I have my pages in pages/ folder, they get picked up correctly by the sidebar.
I have no need for the welcome page, I’d like the first page to be automatically loaded when main.py is ran
Steps to reproduce
My main.py file has effectively nothing in there:
import streamlit as st
# Initialize logging
logger = logging.getLogger(__name__)
My folder structure is:
Expected (or rather, desired) behavior:
I’d like the pages/1_page_one.py to be opened when main.py is ran. I also don’t want to see main.py in page selector.
When I run the 1_page_one.py directly, I see no sidebar. When I run main.py, I get the sidebar and an empty page (space for welcome page).
Good question, @Lucas_Severyn!
I suggest trying the
st-pages module. I haven’t tried it for your specific use case, but I believe it should do what you are after.
Let us know how it goes… and welcome to our forums, by the way!
You could also do this
And then do
streamlit run 1_page_one.py
Not the cleanest solution, but it works. Thanks for the suggestion!
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.