Build and Deploy a Website in 7 Minutes Using Python and Streamlit
A small Streamlit site from an empty folder to a live URL: a holiday greeting page with a theme, a Lottie animation, falling snow and a name taken from the URL. The whole app is about 50 lines of Python, and Streamlit Community Cloud hosts it at no cost.
Project layout
The project needs three folders and two files. The main script is streamlit_app.py, and requirements.txt lists the packages that Streamlit Community Cloud installs when it builds the app.
.streamlit/config.toml
assets/animation_holiday.json
style/style.css
streamlit_app.py
requirements.txt
Theme
The theme colors live in .streamlit/config.toml. The file is optional; without it the app uses the default Streamlit theme. These are the colors of my demo app:
[theme]
primaryColor = "#d33682"
backgroundColor = "#002b36"
secondaryBackgroundColor = "#586e75"
textColor = "#fafafa"
font = "sans serif"
Animation and CSS
The animation is a Lottie file: a JSON file you download from LottieFiles and save in the assets folder. The CSS file in the style folder hides the Streamlit menu and header so the page looks like a plain website.
I cover more options, including loading an animation from a URL, in how to add Lottie animations to a Streamlit app. The CSS selectors change between Streamlit versions, so check how to hide the Streamlit header and menu if the snippet stops working.
#MainMenu {visibility: hidden;}
header {visibility: hidden;}
Requirements
The app needs three packages: streamlit, streamlit_extras for the falling snow and streamlit_lottie for the animation. Put one name per line into requirements.txt and install them locally:
pip install -r requirements.txt
The app code
The script first defines the file paths relative to its own folder, so it finds the CSS and the animation both locally and on the server. Two helper functions load the Lottie JSON and start the snow with rain() from streamlit_extras.
from pathlib import Path
import json
import streamlit as st
from streamlit_lottie import st_lottie
from streamlit_extras.let_it_rain import rain
# Directories and file paths
THIS_DIR = Path(__file__).parent
CSS_FILE = THIS_DIR / "style" / "style.css"
ASSETS = THIS_DIR / "assets"
LOTTIE_ANIMATION = ASSETS / "animation_holiday.json"
# Function to load and display the Lottie animation
def load_lottie_animation(file_path):
with open(file_path, "r") as f:
return json.load(f)
# Function to apply snowfall effect
def run_snow_animation():
rain(emoji="❄️", font_size=20, falling_speed=5, animation_length="infinite")
The page greets the visitor by name. The name comes from the URL, so ?name=Anna at the end of the link shows “Happy Holidays, Anna!”, and a link without a name falls back to “Friend”.
The repository pins Streamlit 1.29 and reads the name with st.experimental_get_query_params(). Current Streamlit versions removed that function, so the code below uses st.query_params, which returns the value as a plain string.
# Function to get the name from query parameters
def get_person_name():
return st.query_params.get("name", "Friend")
With the helper functions in place, the main part of the script sets the page title and icon, starts the snowfall, applies the CSS file, and shows the personalized header, the animation and the message:
# Page configuration
st.set_page_config(page_title="Happy Holidays", page_icon="🎄")
# Run snowfall animation
run_snow_animation()
# Apply custom CSS
with open(CSS_FILE) as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
# Display header with personalized name
PERSON_NAME = get_person_name()
st.header(f"Happy Holidays, {PERSON_NAME}! 🎄", anchor=False)
# Display the Lottie animation
lottie_animation = load_lottie_animation(LOTTIE_ANIMATION)
st_lottie(lottie_animation, key="lottie-holiday", height=300)
# Personalized holiday message
st.markdown(
f"Dear {PERSON_NAME}, wishing you a wonderful holiday season filled with joy and peace. 🌟"
)
Deploy to Streamlit Community Cloud
Streamlit Community Cloud deploys straight from a GitHub repository. Once the app runs locally with streamlit run streamlit_app.py, push the project to GitHub, then create the app in Community Cloud and point it at the repository.
-
Push the code. Initialize a git repository in the project folder, commit the files and publish the branch to GitHub.
-
Create the app. Sign in to Streamlit Community Cloud and choose to deploy a new app.
-
Fill in the form. Pick the repository and branch, enter streamlit_app.py as the main file path and choose the app URL.
-
Deploy. Community Cloud installs the packages from requirements.txt and the app is live after a short wait. Every later push to the branch updates it.

If you want a different host later, the same app also runs on Render, as I show in how to deploy a Streamlit app to Render. For a bigger example with more sections, see how to build a website in 12 minutes with Python and Streamlit.
