Environment Variables in FastAPI — Managing Secrets the Right Way

Posted on Tue 28 September 2027 in Tutorial • Tagged with FastAPI, Python, environment-variables, security, pydantic-settings, deployment

Why This Matters

Almost every FastAPI app eventually needs something it shouldn't have hardcoded in the source code: a database URL, an LLM API key, a JWT secret, a third-party service token. When you're building GenAI apps, this shows up on day one, because you can't call an LLM API …


Continue reading

Why Port Numbers Under 2000 Are Not Recommended in FastAPI

Posted on Tue 01 September 2026 in Tutorial • Tagged with FastAPI, Python, networking, uvicorn, backend, deployment

Why This Matters

When you're setting up a FastAPI app for the first time, it's tempting to just run uvicorn main:app --port 80 and call it a day — no need to remember a weird port number, just hit the domain directly. But if you've tried this, you've probably already …


Continue reading