Summary
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
Code snippet:
My main.py file has effectively nothing in there:
import logging
import streamlit as st
# Initialize logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
My folder structure is:
- Root
- main.py
- pages
- 1_page_one.py
- 2_page_two.py
- 3_page_three.py
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.
Actual behavior:
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).
1 Like
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! 
Best,
Charly
You could also do this
- Root
- 1_page_one.py
- pages
- 2_page_two.py
- 3_page_three.py
And then do streamlit run 1_page_one.py
2 Likes
Not the cleanest solution, but it works. Thanks for the suggestion!
system
Closed
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.