[Update 2020-07-16] Updated the gist to fix the subprocess bug (I think) and a typo with the file save. And, if you’re new to Streamlit reading this, you can try it out the quickest by running the following:
streamlit run https://gist.githubusercontent.com/chad-m/65e3f9d91ef23ced5e83c8a814aee7ae/raw/73de429d1ea6e8d93f33dc5fca6002830dffe49d/streamlit_app_maker.py
Hi all, the Github gist below is for a Streamlit app to make Streamlit apps. I built the prototype this weekend, so rumsfeldian bugs are expected.
For example, the code editor saving is wonky after the first save. I need to include session management code to address this, but still familiarizing myself with Streamlit’s codebase. If anyone has a recommended solution to fix the editor, thank you in advance.
one question: through launching the app as I edit, I notice new processes being spawned up, but cannot bring them down with clearing cache or rerunning. How might I prevent the clutter of jobs? Maybe when hitting “Run App,” it kills the previous process and spawns up at the same port?
[EDIT]: looks like when I shut down the original app, the subprocesses stay up too.
@djdebonis@mathematicalmichael thank you for the feedback! I’m working on a general update given the release of Streamlit components that hopefully will address the editor bug. I’ll work on a fix for the subprocess issue as well, which I suspect is caused by a regex typo.
thanks! feel free to ping me when you do. I really like this project as a way to explore the components and quickly put out some skeleton code.
I also noticed that shutting down and restarting streamlit let me pick up in the same state. not sure if that’s a feature or a bug. I could see that being great for local development, not so great for deployment.
Thank you for sharing! I figured, and hoped, I wasn’t the first
I’m looking forward to checking it out. Now that I’m more familiar with Streamlit (plus components!!!), I’m revamping my approach in general. Still learning up on React, but very much enjoying the extensibility so far.
My approach is quite basic and purely python, keeping to the main streamlit functions.
React and so on are over my pay grade but extending for components is enticing. I hope I find time over the next few weeks to dig into it.
finally got around to sitting down with it for an evening again. It worked swimmingly within docker (which feels a bit like a moving target), but for anyone curious:
Dockerfile
# base image
FROM python:3.7
# streamlit-specific commands
RUN mkdir -p /root/.streamlit
RUN bash -c 'echo -e "\
[general]\n\
email = \"\"\n\
" > /root/.streamlit/credentials.toml'
RUN bash -c 'echo -e "\
[server]\n\
enableCORS = false\n\
enableXsrfProtection = false\n\
" > /root/.streamlit/config.toml'
# exposing default port for streamlit
EXPOSE 8501
EXPOSE 8502
# copy over and install packages
COPY requirements.txt ./requirements.txt
RUN pip3 install -r requirements.txt
# secure container by setting non-root user
WORKDIR /st
RUN useradd appuser && chown -R appuser /st
USER appuser
# run app
CMD streamlit run
requirements.txt
numpy
streamlit
plotly
matplotlib
streamlit is an extensionless shell script that is executable, and referrs to the streamlit:latest from docker build -t streamlit .
this mounts current folder in the app directory, and lets me have this “app builder” running on my computer at all times, looks like I can even edit the text file and streamlit picks up on the changes.
My only problem encountered was an occasional frustration with (i think the browser) caching. Sometimes I would edit the app, click to another window, and come back only to find my changes missing. This happened a few times (which is why I experimented with opening the temporary application file in a text editor, worked great). Thanks so much for fixing the proxying on new ports issue, that enabled me to keep this whole thing containerized and only expose two ports.
Thank you @mathematicalmichael! I’m working on the editor caching issue and some other updates given the new components feature. I’m busy with work projects for the next week or so, and will be pivoting back to this project then.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.