r/FastAPI • • Sep 25 '25

Question Django dev here - need to learn FastAPI in 3 weeks for work. What's the fastest path?

Hey everyone,

So my company is starting a new microservice and they've decided on FastAPI (something about better performance and async support). I've been doing Django for the past few years and pretty comfortable with it, but now I need to get up to speed with FastAPI FAST - like I need to start building actual production stuff in 3-4 weeks.

I'm not starting from zero - I know Python well, understand REST APIs, have worked with DRF, know my way around databases (MYSQL mainly), and I get the general web dev concepts. But FastAPI seems quite different from Django's "batteries included" approach.

For those who've made this jump:

  • What are the biggest differences I should watch out for?
  • Any good resources that specifically help Django devs transition? Most tutorials I'm finding assume you're new to everything
  • What's the FastAPI equivalent of Django's ORM? I see people mentioning SQLAlchemy but also Tortoise-ORM?
  • How do you handle stuff like auth, migrations, admin panel that Django just gives you?
  • Should I bother learning Pydantic separately first or just pick it up as I go?

Also worried about the "blank canvas" problem - Django tells you where to put things, but FastAPI seems more like "do whatever you want" which is kinda overwhelming when you're on a deadline.

My plan so far is to rebuild one of our smaller Django services in FastAPI this weekend as practice. Good idea or should I just follow tutorials first?

Would really appreciate any tips, especially from people who use both frameworks. Thanks!

34 Upvotes

44 comments sorted by

42

u/[deleted] Sep 25 '25

You can learn it in just one week by using the docs, which are very good and up to date.

Build a small API with Pydantic, SQLAlchemy, Alembic, etc. As a Django dev, FastAPI is way easier to grasp, much closer to raw Python.

As for the blank canvas problem, I usually organize my projects like this:

  • Repository for data operations (similar to a manager in Django)
  • Service layer for business logic
  • Schema (similar to a Django model, but with typing and validation out of the box)
  • Endpoint (similar to a views.py)

Then just follow the basic patterns: enums, exceptions, permissions, etc.

3

u/Grouchy-Ad1910 Sep 25 '25

Indeed this was great.
Especially was looking for the project folder structure. Thanks a bunch!!

2

u/[deleted] Sep 27 '25

[removed] — view removed comment

2

u/Grouchy-Ad1910 Sep 27 '25

Yup, trying that!!

0

u/[deleted] Sep 25 '25

[deleted] — view deleted comment

4

u/Commercial-Catch-680 Sep 26 '25

I have an open source app built on FastAPI + Angular.

Github link

11

u/yoppee Sep 25 '25

Read the docs

3

u/Grouchy-Ad1910 Sep 25 '25

For sure. I’m reading them, but hoping for “stuff the docs don’t say”, project structure, auth patterns (JWT/OAuth2), and test setup with pytest/httpx. Any recs? Validations as well.

6

u/CrusaderGOT Sep 25 '25

The docs has sections for all the things you stated. It is a complete course tutorial. It is hands down the best I have read

For ORM use SQLmodel, then later learn pydantic and sqlalchemy if you need to, in order to increase your capabilities with SQLmodel(which is a superset of both).

The main difference from Django is FastAPI is more abstract, you build what you need.

1

u/Grouchy-Ad1910 Sep 26 '25

Yup going through the docs. Is tortoise orm ?? Similar to django orm ?? Heard a lot about it, but not sure to use it or just continue with SQLmodel?

1

u/Drevicar Sep 26 '25

Sqlmodel never lived up to its potential and has been mostly abandoned for a while now receiving only minor dependency bumps. Its feature set lags pretty far behind the ORM that SQLAlchemy itself now has first class by quite a bit.

2

u/Grouchy-Ad1910 Sep 26 '25

Ohhh, so guess SQLAlchemy is the way to go.Thanks for help!!

2

u/Drevicar Sep 26 '25

I personally still do use SQLModel because I just really love working with Pydantic models, however I have to reach under the hood and directly manipulate SQLAlchemy inside the machine to get what I want done and that feels bad. Just know that SQLModel is extremely limited compared to just plain SQLAlchemy.

→ More replies (1)
→ More replies (2)

4

u/PracticalAttempt2213 Sep 26 '25

Recently I built a platform to learn FastAPI interactively in the browser, it's completely free and will help you to understand the fundamentals: FastAPIInteractive.com

1

u/Grouchy-Ad1910 Sep 26 '25

Sure will check it out!!

4

u/gbrennon Sep 26 '25

i would create:

  • repositories for handling the data models in the database
  • services to handle business logic or application logic
  • dataclasses based to return from services to isolate ur entities
  • POPO for entities and dataclasses for DTO
  • presentation layer for isolating pydantic and controllers/handlers/routers to u could avoid validating everytime.

i think u should only validate the payload on, for example, UI. when writing message handlers u should not validate the data because u are responsible for that

3

u/Grouchy-Ad1910 Sep 27 '25

Cheers mate!! Thanks for help!!

2

u/gbrennon Sep 27 '25

Ur welcome! :) that’s how we grow a well structured community 😉

2

u/[deleted] Sep 26 '25

Documentation

2

u/aliparpar Sep 27 '25

@Grouchy-Ad1910 Start with the docs then get my FastAPI book, I cover everything else inside. Authentication, Concurrency, realtime streaming, databases, AI integration, deployment. Etc. chapter 2 gives a broad overview coming from Django.

https://buildinggenai.com

2

u/Grouchy-Ad1910 Sep 27 '25

Sure mate!! Will have a look.

2

u/kryvoff Sep 28 '25

Example project from the FastAPI author is worth a look: https://github.com/fastapi/full-stack-fastapi-template

1

u/Grouchy-Ad1910 Sep 28 '25

Thanks bro!! Will check it out!!

2

u/ChocolateEpiphany Sep 29 '25

Official docs.

1

u/Grouchy-Ad1910 Sep 29 '25

Yup, Indeed they helped me a lot!!

2

u/[deleted] Oct 01 '25

Django skills are easily transferable to fastapi don't worry you'll be ready in no time

1

u/Grouchy-Ad1910 Oct 01 '25

Yup getting in sync with FastApi , it's pretty cool!! Especially when you have more control.

1

u/Yash284_06 Oct 11 '25

I would recommend fastapi tutorial on bitfumes.

0

u/[deleted] Sep 25 '25

[deleted] — view deleted comment

1

u/Grouchy-Ad1910 Sep 26 '25

Bro, this was indeed the answer I was looking for!!! Thanks a lot, will surely look at django-ninja.

2

u/[deleted] Sep 29 '25

[removed] — view removed comment

1

u/Grouchy-Ad1910 Sep 29 '25

Well cannot judge as it's my first framework with least batteries included 😊!!!

1

u/[deleted] Sep 29 '25

[removed] — view removed comment

1

u/Grouchy-Ad1910 Sep 29 '25

Yup, will follow the same!!! Thanks.

1

u/[deleted] Sep 25 '25

[removed] — view removed comment

2

u/Grouchy-Ad1910 Sep 26 '25

Sure will give it a try.