DEV Community

Brian Kipchirchir
Brian Kipchirchir

Posted on

The Local Dev Setup Cheat Sheet I Wish I Had When I Started 🐍⚑

πŸ—‚οΈProject WITHOUT React/Vite (Python backend + plain HTML/CSS/JS frontend)

Backend:

source .venv/bin/activate
python app.py

Frontend (no build tool needed β€” just serve the static files):

python3 -m http.server 5500

or right-click index.html β†’ "Open with Live Server" if you're in VS Code.

βš›οΈ Project WITH React/Vite (Python backend)

Backend:

source .venv/bin/activate
python app.py

Frontend:

npm run dev

πŸ—‘οΈ *Deleting a virtual environment
*

deactivate
rm -rf .venv

✨** Creating a fresh one
**
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

πŸ†• First time in a project only do:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

πŸ” Every time after:

source .venv/bin/activate
python app.py

πŸ” Check if venv exists:
ls -a β†’ spot .venv in the list

βœ… Check if venv is actually active:
which python β†’ should point inside .venv
⚠️ don't fully trust the (.venv) label in your prompt β€” it can lie!

♻️ Only redo the first-time steps if:

πŸ—‘οΈ you delete .venv
πŸ’» you're on a new machine
πŸ“¦ requirements.txt got new packages

Top comments (0)