Can fastapi be used for api endpoints and django in operations such as orm and database (everyone is good at it) and Roby’s fastapi course on udemy is amazing⭐️
Used fastapi for 8 months, it's really fast and works with almost any existing python package, but the django ORM and admin panel is a significant advantage that DRF has over fastapi. I believe that using one over the other boils down to whether you need the django ORM & admin and the django packages provided by the community, or you want to have control over every part of your API and a few ms in performance improvement is worth the switch and someone else is building the admin panel.
I was going to use django rfw or even django ninja but i decided to use fastapi in the end. Django is good but i already made my front end and it seemed complicated to get it working solely as a backend.
For sure, if you are using DRF on a Django project then its great. If you are not and wanting to create a project from scratch I'd choose FastAPI every single time.
Django is not dying, but FastAPI is a better tool than DRF. Django is a full framework that allows you to do everything in a single framework. FastAPI allows you to get going quicker but you may have to do a bit more.
Pydantic is a data validation library. It has nothing to do with SQLModel (an ORM) outside the fact that SQLModel uses it for db data validation behind scenes
I am 100% sure your 89.75% is wrong 😉 - at a minimum there should be three areas of data validation. 1. At the client level (not pydantic). 2A. At the transfer/endpoint level. This is the DTO coming into the backend from a client. Validation of all pieces of info, making sure data is valid before transforming into a table entity or performing business logic. 2B. Path and query Params are valid. For example making sure an ID is always positive, or a string parameter has at least 5 characters, etc. (both points of 2 is why FastAPI comes with pydantic as well). You can also validate headers, etc. 3. Database validation which is what you suggested.
You are comparing an apple & a banana and asking which one is mostly an apple. ye obviously, it's the apple. django by default is sync & fastapi is async which means fastapi should be faster & by huge margins have a lower latency
Need a full fledged FastAPI project with authentication and ReactJS as frontend
I have that on my channel split between two videos.
He has a next.js video which uses fastapi as the backend and includes jwt, sqlalchemy, etc.
Can we get some production grade fast api project?
The problem is Django ORM is better, That's why Django is still better. You can optimize DRF for latency and speed.
Ohhhh, idk about that one. SQLModel is pretty freaking awesome nowadays.
@@codingwithrobynot for every project
Can fastapi be used for api endpoints and django in operations such as orm and database (everyone is good at it) and Roby’s fastapi course on udemy is amazing⭐️
Used fastapi for 8 months, it's really fast and works with almost any existing python package, but the django ORM and admin panel is a significant advantage that DRF has over fastapi.
I believe that using one over the other boils down to whether you need the django ORM & admin and the django packages provided by the community, or you want to have control over every part of your API and a few ms in performance improvement is worth the switch and someone else is building the admin panel.
You should have compare Async Django vs Async FastAPI. DRF is not async yet
I'll look into it 😎
Can you please make a similar comparison video between Async Django Ninja and FastAPI?
It is on the backlist of content for me to make 🙂
I was going to use django rfw or even django ninja but i decided to use fastapi in the end. Django is good but i already made my front end and it seemed complicated to get it working solely as a backend.
As stand alone frameworks, FastAPI is better. If you want to use Django, then DRF is not a bad attachment.
I'm using django as fullstack and that's why I have to use Django REST for the mobile app it's not bad but I wish it would improve its performance
For sure, if you are using DRF on a Django project then its great. If you are not and wanting to create a project from scratch I'd choose FastAPI every single time.
Looking for a course with FastAPI and Next.js with all auth features 😢
I have a 90 min tutorial here that shows you that.
@@codingwithroby oh wow gonna check that out thanks!
if we have large scale features ..I means we have various features to take care in a webapp ..In that case also can we consider FastApi?
For sure!
Any other comparisons you want to see?
Python vs java as backend
sir plz launch proper fast API series with complex project
FastAPI vs Django-ninja
wow, that's one FULL head of hair "you" had there in that clip :o
Did you just make a bald joke?
So... is django dying? What would be a good use case for it?
Django is not dying, but FastAPI is a better tool than DRF. Django is a full framework that allows you to do everything in a single framework. FastAPI allows you to get going quicker but you may have to do a bit more.
How about fastapi vs django ninja!!
haha so many variations. I'll take a look and do a comparison!
I hope by Pydantic you mean `SQLMODEL` in the modern world.
Pydantic is a data validation library. It has nothing to do with SQLModel (an ORM) outside the fact that SQLModel uses it for db data validation behind scenes
@@codingwithroby And I am 89.75% sure that you don't use Pydantic for anything else other than DB validation.
I am 100% sure your 89.75% is wrong 😉 - at a minimum there should be three areas of data validation. 1. At the client level (not pydantic). 2A. At the transfer/endpoint level. This is the DTO coming into the backend from a client. Validation of all pieces of info, making sure data is valid before transforming into a table entity or performing business logic. 2B. Path and query Params are valid. For example making sure an ID is always positive, or a string parameter has at least 5 characters, etc. (both points of 2 is why FastAPI comes with pydantic as well). You can also validate headers, etc. 3. Database validation which is what you suggested.
FastAPI vs Django-ninja pls
I added to the list of future comparisons 🙂
compare with django-ninja
Not a bad idea! I'll add it to the list.
Like for your effort and performances Figure ❤
Aww, thank you friend!
You are comparing an apple & a banana and asking which one is mostly an apple. ye obviously, it's the apple. django by default is sync & fastapi is async which means fastapi should be faster & by huge margins have a lower latency
Our company is already using fastapi since 2021
Heck yeah, you're company knows what is up.