Posts by FarmDogs

FarmDogs's profile picture

Schafer? I Barely Know Her!

Is anyone actually reading these blog posts? Do they really need to say anything? I can keep going all day. At least AI can... Claude, keep going, please.

FarmDogs's profile picture

SQLAlchemy 2.0 Is Worth the Upgrade

If you're still using SQLAlchemy 1.x patterns, it's time to upgrade. The new 2.0 style with select() and mapped_column() is much more explicit and works beautifully with async.

FarmDogs's profile picture

Path Parameters vs Query Parameters

Use path parameters for required resource identifiers (/users/123) and query parameters for optional filters (/posts?author=corey&limit=10). FastAPI handles both beautifully with automatic validation.

FarmDogs's profile picture

CORS: The Bane of Frontend Devs

Getting CORS errors? FastAPI's CORSMiddleware is your friend. Just remember: be specific about allowed origins in production. Don't use '*' unless you really mean it.

FarmDogs's profile picture

Rate Limiting Your API

Protect your API from abuse with rate limiting. Too many requests? Return 429 Too Many Requests. Your server (and your wallet) will thank you.

FarmDogs's profile picture

Debugging Async Code

Async bugs can be tricky. Use logging liberally, understand the event loop, and don't mix sync and async without care. asyncio.run() is your entry point.

FarmDogs's profile picture

Security Headers Matter

Add security headers to your responses: X-Content-Type-Options, X-Frame-Options, Content-Security-Policy. Small effort, big security improvement.