How to set the default page in multipage app? (I don't want to use main/welcome page)


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 is ran

Steps to reproduce

Code snippet:

My file has effectively nothing in there:

import logging
import streamlit as st

# Initialize logging
logger = logging.getLogger(__name__)

My folder structure is:

- Root
  - pages

Expected (or rather, desired) behavior:

I’d like the pages/ to be opened when is ran. I also don’t want to see in page selector.

Actual behavior:

When I run the directly, I see no sidebar. When I run, 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! :wink:


You could also do this

- Root
  - pages

And then do streamlit run


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.