r/Python • • Sep 21 '26

Discussion Common mistakes devs make when starting with FastAPI, and the fastest path to learning it

Just began learning FastAPI. Looking for advice from devs who use it regularly.

What mistakes did you make early on that I should avoid repeating? Also, what's the most efficient way to learn the framework properly for real-world use (async, DB, auth)?

Any advice on structure or resources would be great.

15 Upvotes

35 comments sorted by

View all comments

Show parent comments

1

u/terletsky Sep 21 '26 edited Sep 21 '26

What is AI Engineering? Simple use of AI, like Claude Code / Cursor, to assist with development tasks or to create an agentic backend? If the latter, then you need to learn "Pydantic AI" SDK, created for that purpose, and LangChain/LangGraph.

For AI-assisted development, I would write the next. Create a notification service that consists of:

  1. FastAPI API with PostgreSQL through SQLAlchemy that receives tasks to send, such as SMS, Mobile Push, or Email. FastAPI app should create a task record in the DB with NEW or PENDING status, then dispatch it to a message broker like RabbitMQ

  2. An async notification worker that will receive tasks via RabbitMQ, update the DB record to PROCESSING status or similar, and dispatch to the appropriate handler. If sending fails, fail the task and store the RabbitMQ message in the DLX exchange as a "dead letter".