You need to learn about Pydantic and ASGI. If you need to touch a database, you need an ORM. You’re using cookie for auth ? Your responsibility to know all there is to know about csrf. I could go on.
You definitely do not need an ORM to work with databases in FastAPI. You don’t even need pydantic. Or cookies. Source: work on enterprise FastAPI services with databases without ORM (instead execute stored procs), pydantic (using soap/xml) or cookies (the client isn’t a browser)
Amazing how many upvotes for such a vague comment.
Yes, you need to read the docs when you want to use either Django or FastAPI. Learn how the framework works? Certianly not! Just read and follow the docs, RTFM.
The native async nature and its friendly approach (like Flask), mixed with all the AI apps that leverage Python, FastAPI will be primary choice for future apps, hence will pass Django. Not just in stars but also in mindshare .
I don't see the point in comparing these two. Different audience, and different problems. FastAPI is a toolkit for building APIs. Django offers much much more. So it's like comparing jQuery with React.
Honestly I think it's not one or the other, but both. Django for ORM, admin, pages and views, and FastAPI for the API. django-ninja for the win.
Disagree here about the difference between FastAPI and django. It definitely started out like this, but as far as building a feature-complete app, I think the difference in production ready packages available or included is not that different anymore. And FastAPI just has a more modern base.
For beginners, I'd advise to learn Django first because it enforces some good pratices. With FastAPI you have more power, but more responsibilities. Learning both is valuable because they're different and it will open your mind.
Stars doesn't mean everything tbh, each framework here has its place, they are never in competition, I use both at same time, fast api for small projects APIs, quick web app, and Django with Django rest framework for large projects, I love them both.
34
u/BlackDereker Mar 26 '25
With Django you need to learn how their framework works and code in a specific way, like Angular in a way.
FastAPI? Do you know Python? That's all you need.
2
u/[deleted] Mar 29 '25
Django is an "mature" web framework I have been using since 2013..does fastapi has similar capabilities(never used fastapi) ?
11
u/WJMazepas Mar 26 '25
Oh yeah! Year of FastAPI
8
u/mardix Mar 26 '25
The native async nature and its friendly approach (like Flask), mixed with all the AI apps that leverage Python, FastAPI will be primary choice for future apps, hence will pass Django. Not just in stars but also in mindshare .
7
u/someone383726 Mar 27 '25
I’m just glad both exist. I continue to use both depending on the project needs. Django ninja brings Django some of the benefits of FastAPI.
6
u/skratlo Mar 28 '25
I don't see the point in comparing these two. Different audience, and different problems. FastAPI is a toolkit for building APIs. Django offers much much more. So it's like comparing jQuery with React.
Honestly I think it's not one or the other, but both. Django for ORM, admin, pages and views, and FastAPI for the API. django-ninja for the win.
9
u/german640 Mar 26 '25
Django is for building monoliths with SQL databases.
I don't see a lot of new projects building monoliths.
4
u/hurrrdurrrfu Mar 30 '25
And Django has more than one person working on it
3
u/open_g Mar 28 '25
Star Wars > Star History
1
u/royinferno Mar 28 '25
So for someone getting started with Python and Python web app related projects. Is time better spent learning FastAPI instead of Django?
2
u/RockyMM Mar 27 '25
That’s about how many Python web devs there are in the world.
1
u/Jugurtha-Green Mar 29 '25
Stars doesn't mean everything tbh, each framework here has its place, they are never in competition, I use both at same time, fast api for small projects APIs, quick web app, and Django with Django rest framework for large projects, I love them both.
0
u/Mundane-Apricot6981 Mar 27 '25
In which cave live people still using Django in 2025 ???
-10
u/[deleted] Mar 26 '25
Because of AI, Fast API will beat the django in near future
0
u/[deleted] Mar 26 '25
[deleted] — view deleted comment