Multi Page Apps#
Migrating your Streamlit multi page app to Panel is simple. In Panel each page is simply a file that you serve
panel serve home.py page1.py page2.ipynb
Besides that, a couple of useful flags to further configure a multi-page deployment are:
--index
: Set as site index the application page of your preference. For example, to leave the home application page as index you can pass--index=home
panel serve home.py page1.py page2.ipynb --index=app
The
--index
flag also supports a path to a custom Jinja template to be used as index. For this template, the following variables will be available:PANEL_CDN
: URL to the Holoviz Panel CDN.prefix
: The base URL from where applications are being served.items
: List of tuples with the application page slug and title to display.
--index-titles
: Set the titles for the application items shown in the default index page as cards. By default, the titles shown are the applications page slug as a title (without slash and first letter to uppercase). You can use this flag to, for example, show instead ofPage1
andPage2
different titles likePage 1
andPage 2
panel serve home.py page1.py page2.ipynb --index-titles /page1="Page 1" /page2="Page 2"