FastAPI vs. Django REST Framework: Which One Should You Choose?

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

Комментарии • 45

  • @coderush24
    @coderush24 5 месяцев назад +14

    Need a full fledged FastAPI project with authentication and ReactJS as frontend

    • @codingwithroby
      @codingwithroby  5 месяцев назад +3

      I have that on my channel split between two videos.

    • @SageManOfficial
      @SageManOfficial 5 месяцев назад +1

      He has a next.js video which uses fastapi as the backend and includes jwt, sqlalchemy, etc.

    • @farismecinovic1499
      @farismecinovic1499 5 месяцев назад +1

      Can we get some production grade fast api project?

  • @my_name_is_ahad
    @my_name_is_ahad 5 месяцев назад +12

    The problem is Django ORM is better, That's why Django is still better. You can optimize DRF for latency and speed.

    • @codingwithroby
      @codingwithroby  5 месяцев назад +2

      Ohhhh, idk about that one. SQLModel is pretty freaking awesome nowadays.

    • @AsifSaifuddinAuvipy
      @AsifSaifuddinAuvipy 3 месяца назад +1

      ​@@codingwithrobynot for every project

    • @eymenongel6770
      @eymenongel6770 2 месяца назад

      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⭐️

  • @hmaina0
    @hmaina0 4 месяца назад +7

    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.

  • @AsifSaifuddinAuvipy
    @AsifSaifuddinAuvipy 3 месяца назад +4

    You should have compare Async Django vs Async FastAPI. DRF is not async yet

  • @ruksharalam173
    @ruksharalam173 2 месяца назад +1

    Can you please make a similar comparison video between Async Django Ninja and FastAPI?

    • @codingwithroby
      @codingwithroby  2 месяца назад +1

      It is on the backlist of content for me to make 🙂

  • @SageManOfficial
    @SageManOfficial 5 месяцев назад

    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.

    • @codingwithroby
      @codingwithroby  5 месяцев назад

      As stand alone frameworks, FastAPI is better. If you want to use Django, then DRF is not a bad attachment.

  • @onclick-xt3mu
    @onclick-xt3mu 4 месяца назад

    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

    • @codingwithroby
      @codingwithroby  4 месяца назад +1

      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.

  • @codernerd7076
    @codernerd7076 5 месяцев назад +3

    Looking for a course with FastAPI and Next.js with all auth features 😢

    • @codingwithroby
      @codingwithroby  5 месяцев назад +1

      I have a 90 min tutorial here that shows you that.

    • @codernerd7076
      @codernerd7076 5 месяцев назад +1

      @@codingwithroby oh wow gonna check that out thanks!

  • @aibasics7206
    @aibasics7206 4 месяца назад

    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?

  • @codingwithroby
    @codingwithroby  5 месяцев назад +3

    Any other comparisons you want to see?

    • @_Software_developer_
      @_Software_developer_ 5 месяцев назад +1

      Python vs java as backend

    • @moinuddin-x6u
      @moinuddin-x6u 5 месяцев назад

      sir plz launch proper fast API series with complex project

    • @suriya_gm
      @suriya_gm 5 месяцев назад +2

      FastAPI vs Django-ninja

  • @helloquico
    @helloquico 2 месяца назад

    wow, that's one FULL head of hair "you" had there in that clip :o

  • @joshthe10xengineer
    @joshthe10xengineer 5 месяцев назад

    So... is django dying? What would be a good use case for it?

    • @codingwithroby
      @codingwithroby  5 месяцев назад +1

      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.

  • @hasibulalamprionto2010
    @hasibulalamprionto2010 3 месяца назад +1

    How about fastapi vs django ninja!!

    • @codingwithroby
      @codingwithroby  3 месяца назад +2

      haha so many variations. I'll take a look and do a comparison!

  • @dev-akeel
    @dev-akeel 4 месяца назад

    I hope by Pydantic you mean `SQLMODEL` in the modern world.

    • @codingwithroby
      @codingwithroby  4 месяца назад +2

      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

    • @dev-akeel
      @dev-akeel 4 месяца назад

      @@codingwithroby And I am 89.75% sure that you don't use Pydantic for anything else other than DB validation.

    • @codingwithroby
      @codingwithroby  4 месяца назад +1

      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.

  • @suriya_gm
    @suriya_gm 5 месяцев назад

    FastAPI vs Django-ninja pls

    • @codingwithroby
      @codingwithroby  5 месяцев назад

      I added to the list of future comparisons 🙂

  • @BeyondTheFirstPage
    @BeyondTheFirstPage 5 месяцев назад

    compare with django-ninja

    • @codingwithroby
      @codingwithroby  5 месяцев назад

      Not a bad idea! I'll add it to the list.

  • @_Software_developer_
    @_Software_developer_ 5 месяцев назад

    Like for your effort and performances Figure ❤

  • @kenmachine
    @kenmachine Месяц назад

    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

  • @krishnaagarwal7934
    @krishnaagarwal7934 5 месяцев назад

    Our company is already using fastapi since 2021

    • @codingwithroby
      @codingwithroby  5 месяцев назад +2

      Heck yeah, you're company knows what is up.