Hello Community,
I want to create access a file that is not stored in the pages folder like:
app/
app/menu.py
app/pages/1.py
app/pages/main.py
app/report/my-report.html
here is the example of my app/menu.py:
import streamlit as st
import os,sys
def custom_menu():
st.sidebar.page_link("./pages/1.py", label="page 1")
st.sidebar.page_link("./report/my-report.html", label="view report")
here is the example of app/.streamlit/config.toml
[client]
showSidebarNavigation = false
now if i try to access it with app/pages/main.py:
from menu import custom_menu # Import the custom menu function
# Display the custom menu
custom_menu()
then i’m getting this error:
StreamlitAPIException: Could not find page: ./report/my-report.html. Must be the file path relative to the main script, from the directory: app. Only the main app file and files in the pages/ directory are supported.