I am building an app that has 5 pages. On the landing page of the app the user can save different projects.
I need to be able to use a unique set of the 5 pages for each project.
I have tried several approaches - but no joy - so any help would be great
import os
import streamlit as st
from streamlit import session_state as ss
NAME = "Create Project"
DESCRIPTION = "Creates project"
ICON = "🐥"
def create_project_cb():
path = os.path.join('./pages/project', ss.project_name)
os.mkdir(path)
with open(f'{path}/__init__.py', 'w') as f:
f.write(f'''import streamlit as st
NAME = "{ss.project_name}"
DESCRIPTION = "{ss.project_desc}"
def main():
st.write(f"Welcome to {ss.project_name}'s Page")
'''
)
def main():
with st.form('form'):
st.text_input('Project Name', key='project_name')
st.text_input('Project Description', key='project_desc')
st.form_submit_button('Create Project', on_click=create_project_cb)