Debugging FastAPI Applications in VS Code: A Complete Guide Ever set a breakpoint in VS Code, run your FastAPI app with uvicorn, hit the endpoint… and nothing happens? You’re not alone—and the fix is simpler than you think. The core issue: When you start your FastAPI server from the terminal, VS Code’s debugger isn’t attached to the process. Your breakpoints exist only in the editor, not in the running app. ✅ The solution: Launch your FastAPI app through VS Code’s debugger using a proper launch.json configuration. Once you do that, breakpoints, step-through execution, variable inspection, and all debugging tools work flawlessly. What this guide covers: Why breakpoints don’t trigger when using terminal-run uvicorn How to configure launch.json correctly for FastAPI Running and debugging with debugpy + uvicorn Laptop-friendly debugging shortcuts (Fn keys included) Step Into vs Step Over (and when to use each) Common debugging pitfalls and how to fix them Result: Set up your debugger once, and you’ll never struggle with “breakpoint not hit” issues again. Debugging FastAPI becomes predictable, fast, and frustration-free. If you’re building APIs with FastAPI and VS Code, this setup is a must-have in your workflow. Happy debugging! Read more with setup guide : https://lnkd.in/dfgqJVMs #FastAPI #Python #VSCode #Debugging #BackendDevelopment #APIDevelopment #WebDevelopment #SoftwareEngineering #PythonDevelopers #Uvicorn #DeveloperTips #Programming #CodingLife #TechGuide #LearnPython #DevTools #EngineeringBestPractices #SoftwareDevelopment #DebuggingTips
Debugging FastAPI with VS Code: Setup and Best Practices
More Relevant Posts
-
𝐕𝐒 𝐂𝐨𝐝𝐞 𝐜𝐚𝐧 𝐧𝐨𝐰 𝐩𝐫𝐞𝐯𝐢𝐞𝐰 𝐒𝐌𝐈𝐋𝐄𝐒 + 𝐒𝐄𝐋𝐅𝐈𝐄𝐒 𝐝𝐢𝐫𝐞𝐜𝐭𝐥𝐲 𝐢𝐧 𝐭𝐡𝐞 𝐞𝐝𝐢𝐭𝐨𝐫! MolView – SMILES Preview update: since the initial release of the extension, almost 150 people have installed it, which honestly made my week! Hopefully it’s making even a tiny part of your workflow easier and a bit more fun. Several of the new features came straight from community feedback and I wanted to share a few highlights. SELFIES support, for example, started as a comment from prof. Alán Aspuru-Guzik on my original post and turned into a fun rabbit hole: I built a TypeScript SELFIES library (ported from the original Python implementation from Aspuru-Guzik group; with gracious help of my coding partner Claude) and integrated it into the extension. I tested it extensively myself but I can’t wait for everyone to try it out and share their thoughts and feedback. With that, here’s everything new in v0.0.7: • Hover to visualize structure from SMILES or SELFIES (simple SMARTS work as well!) • Side-panel viewer to collect and compare molecules • Quick view of physicochemical properties (MW, LogP, HBD/HBA, rotatable bonds, TPSA) shown with structure in side panel — thanks to Rishi Gupta for the idea! • One-click actions: Copy SMILES, export SVG, or export list of SMILES of loaded molecules as .txt • Caching of seen SMILES for faster hover rendering Tip: update to version 0.0.7, restart VS code, then click on a SMILES/SELFIES string and press 𝘊𝘮𝘥+𝘖𝘱𝘵𝘪𝘰𝘯+𝘝 (𝘊𝘵𝘳𝘭+𝘈𝘭𝘵+𝘝 on Windows) to open it in the side-panel viewer (demo below). If you’re using MolView and have feedback/thoughts/ideas (or want to contribute to code) I’d love to hear from you! Repo links in the comment :) #cheminformatics #computationalchemistry #vscode #opensource #devtools #SELFIES
To view or add a comment, sign in
-
🚀 𝗦𝗵𝗶𝗽𝗽𝗲𝗱 𝗠𝘆 𝗙𝗶𝗿𝘀𝘁 𝗣𝘆𝘁𝗵𝗼𝗻 𝗣𝗮𝗰𝗸𝗮𝗴𝗲 𝗼𝗻 𝗣𝘆𝗣𝗜… 𝗮𝗻𝗱 𝗦𝗼𝗺𝗲𝘁𝗵𝗶𝗻𝗴 𝗪𝗶𝗹𝗱 𝗛𝗮𝗽𝗽𝗲𝗻𝗲𝗱 📝✨ I thought this would be a simple “publish & move on” project. Turns out… it became one of the biggest learning curves of my dev journey. 👀🔥 💥 Broken builds 💥 Weird packaging errors 💥 Unexpected CLI bugs And a lot of “why is this even failing?” moments. But today… after all the chaos: 𝗧𝗼𝗱𝗮𝘆, 𝗜 𝗼𝗳𝗳𝗶𝗰𝗶𝗮𝗹𝗹𝘆 𝘀𝗵𝗶𝗽𝗽𝗲𝗱 𝗧𝗲𝘅𝘁𝗻𝗼𝘁𝗲𝘀 🐍 A tiny CLI tool. One command. Surprisingly useful. 💡 The biggest win? Not just shipping… Learning how packaging works, debugging real-world errors, and shipping something people can actually use. 👉 Read the full story: 🌐 https://lnkd.in/db7a5neY 𝗧𝗿𝘆 𝗜𝘁: 🐍 PyPI → https://lnkd.in/dpzhWn_A 💻 GitHub → https://lnkd.in/dS9W57bE 🔁 Share to help others ❤️ Like if you found it useful 📥 Save for your next project 👥 Tag someone who needs this #python #pythonprogramming #KnowledgeSharing
To view or add a comment, sign in
-
🚀 Shipped a new release today! Just pushed #pybgworker v0.3.0 live on #PyPI — a lightweight Python background worker to handle tasks, scheduling, and async jobs more easily. What started as a small utility for my own projects is slowly turning into something other developers can use too. Seeing people install and use something you built is honestly a great feeling. 🔥 What’s improved? • Better task handling • Stability & performance upgrades • Cleaner execution flow • Bug fixes & refinements Upgrade with: pip install pybgworker --upgrade 📦 PyPI package: https://lnkd.in/grFEKwxJ 💻 GitHub repository: https://lnkd.in/gDzM_X3J Still improving it step by step. Feedback, ideas, and contributions are welcome — open source grows with community support. Small releases today, bigger systems tomorrow. 🚀 #Python #OpenSource #BuildInPublic #Developers #PyPI #Programming #SoftwareDevelopment #IndieDev #100DaysOfCode
To view or add a comment, sign in
-
-
Fresh DB. Clean slate. First ever docker-compose up. And it throws a duplicate table error. How?? There's nothing there. I created nothing. It's literally the first run. ... Turns out, the fastapi app was getting spun up like this > command: gunicorn app.main:app -w 4 .... Looking closely, gunicorn was spinning up 4 workers simultaneously. Every single one of them called create_tables() on boot. Race condition on a clean slate! 🏎️ 💨 Root cause: multi-worker setup + app-level table creation = workers racing each other Fixes: • Dev → switch to uvicorn (single worker, problem gone) • Prod → run an init container or entrypoint script to handle table creation before gunicorn starts • Code-level → make table creation idempotent, handle duplicates gracefully Building a side project is just debugging with extra steps 🥲 #Docker #Python #FastAPI #SideProject #DevLog #BuildingInPublic
To view or add a comment, sign in
-
I recently posted about "Agentic Workflows" and separately on "How to train your program verifier" (a3-python based on the z3 theorem prover). You can use a3-python from Agentic workflows. Here is how: From your repository, install AW. Then add the a3-python workflow using: gh aw add https://github.com/ (avoid link shortening, so adding newline here) Z3Prover/z3/blob/master/a3/a3-python.md see gh.io/gh-aw for instructions on installing AW. Run the action (fx. from GitHub portal). It will scan your python files, post-process them (with your copilot tokens) and creates a GitHub issue if it finds issues with your python files.
To view or add a comment, sign in
-
pip install gone?? It’s kind of crazy when you think about how many tools and packages exist in the Python ecosystem. Yet we’re always looking for the same thing: something efficient, simple, and easy to set up. That’s where I’ve found uv to be useful compared to pip. Most of us are used to the traditional workflow - pip install, - manage a requirements.txt, - run pip freeze, deal with version drift later. uv simplifies that. Instead of manually maintaining requirements.txt, it uses: - pyproject.toml to define your dependencies - uv.lock to automatically lock exact versions Much faster installs. Cleaner virtual environment management. It feels like a modern upgrade to the old pip workflow. It’s newer, so teams should align before switching. But if you’re looking for a smoother Python setup experience, it’s definitely worth exploring. Have you used uv? What’s your experience? #uv #pip #moderndatascience
To view or add a comment, sign in
-
-
I built a real-time session monitor for Claude Code. When you're running 3-5 Claude sessions across different projects, you lose track fast. Which one finished? Which one is waiting for input? What was that session even doing? So I built this: a floating macOS dashboard that tracks every Claude Code session in real time. Here's what it does: → Live status tracking (working / awaiting input / idle) → Project grouping with tool usage stats → Sound notifications when Claude finishes → Click any session to jump to its terminal → Auto-generated session titles via local Ollama → Session history with one-click resume → Always-on-top native window, visible on all Spaces The best part? Zero dependencies. Pure Python stdlib + macOS built-ins. No npm, no pip install, no Electron. It works through Claude Code's hooks system — a few Python scripts that intercept every event (tool calls, prompts, agent spawns) and pipe them into a lightweight web dashboard served from localhost. 4 files. Copy, paste, done. Full setup guide with all the code: [GitHub link in comments] If you're running multiple Claude Code sessions daily, this changes the workflow completely. You stop context-switching to check "is it done yet?" and start actually working in parallel. #ClaudeCode #AI #DeveloperTools #Automation #BuildInPublic
To view or add a comment, sign in
-
-
Flight&Balance version 11 is live. Not vibecoded but with support of AI. 51 UI pages. 67 API endpoints across 41 controllers. This completely replaces a 5 year old Python Django based system. The code quality is good; fixes are easy. Docker and Playwright based end-to-end tests. Unit tests of course. 95% fully generated code. I handled the tickets (user stories), code reviews and the pull requests.
To view or add a comment, sign in
-
🚀 Split Terminals in Antigravity & VS Code When building, keeping your frontend and backend logs visible at the same time is a game-changer for staying in the flow. Whether I'm in VS Code or the new Antigravity IDE, I rely on the split terminal view to keep my environment organized. By using Oh My Posh, the name of the folder I've switched into is automatically displayed in the prompt. This gives me instant visual context—I can see exactly where my Vite dev server is running vs. my backend without ever needing to rename a tab. The Setup: 1. Open the Terminal in either IDE. 2. Click the Split Terminal icon (top right) to create side-by-side panes. 3. `cd` into your folders, and let your prompt handle the labeling. It’s a simple, low-maintenance way to keep "mission control" right at the bottom of your editor. #WebDev #Antigravity #VSCode #Python #DeveloperProductivity #OhMyPosh
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development