How to Deploy Data Science Web App to Streamlit Sharing | Github

Опубликовано: 12 Май 2026
на канале: Programming Academic
172
3

Deploying a Streamlit app on GitHub and Streamlit Sharing involves a straightforward process. Here's a step-by-step guide:

Data Science APP: https://data-science-app-nkcappwrg8kr...
Deploying on Streamlit Sharing:
Prepare Your Streamlit App:

Make sure your Streamlit app is working locally.
Ensure that your app is contained in a single Python script (e.g., app.py).
Create a GitHub Repository:

If you don't already have one, create a GitHub repository to host your Streamlit app.
Push Your Code to GitHub:

Use the following commands to push your code to GitHub:

bash
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/your-username/your...
git branch -M main
git push -u origin main
Deploy on Streamlit Sharing:

Visit Streamlit Sharing.
Log in with your Streamlit account.
Follow the instructions to deploy your app directly from your GitHub repository.
Deploying on GitHub Pages:
Prepare Your Streamlit App:

Ensure your Streamlit app is contained in a single Python script (e.g., app.py).
Create a GitHub Repository:

If you don't already have one, create a GitHub repository for your Streamlit app.
Create a docs Folder:

In your repository, create a folder named docs.
Move your Streamlit app file (app.py) and any necessary assets into the docs folder.
Configure GitHub Pages:

Go to your GitHub repository Settings.
In the GitHub Pages section, set the source branch to main (or master) and the folder to /docs.
Push Your Code to GitHub:

Use the following commands to push your code to GitHub:

bash
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/your-username/your...
git branch -M main
git push -u origin main
Access Your Streamlit App:

Your Streamlit app should now be accessible at https://your-username.github.io/your-....
Notes:
GitHub Pages is suitable for static content, and it might not work well for Streamlit apps with dynamic interactions.
Streamlit Sharing is designed specifically for deploying Streamlit apps and is a recommended choice for Streamlit applications.
Remember to replace "your-username" and "your-repo" with your actual GitHub username and repository name.
#data science #machine learning #streamlit#build web app with python #build data app with python #streamlit python #streamlit tutorial #how to use streamlit #machine learning web app #deploy machine learning #python web app #web app python #how to streamlit #deploy streamlit app #deploy streamlit app to streamlit sharing #how to deploy streamlit app #streamlit sharing #streamlit share #how to deploy to streamlit sharing #how to deploy to streamlit share #python streamlit