Django Ninja - The new DRF killer?! 🥷

Sdílet
Vložit
  • čas přidán 8. 08. 2024
  • Django Ninja is getting a lot of attention online.
    I show you how to build a simple API, with built in docs, using Django Ninja (a package for Django).
    (Spoiler: such a nice way to create APIs FAST!)
    ✍️ Check out my other written guides here: www.photondesigner.com/articl...
  • Jak na to + styl

Komentáře • 16

  • @jayesh_15
    @jayesh_15 Před měsícem

    Well the code part is similar to using the Response of DRF and thus removing the need for a serializer... Doesn't look like a stellar upgrade to get to or am I missing something here?

    • @tomdekan
      @tomdekan  Před měsícem

      There are quite a few nice Django Ninja features v DRF: check out this Jayesh: django-ninja.dev/motivation/
      I probably wouldn't switch from DRF to Ninja if I was using DRF. But I would start all new Django APIs with Django Ninja

  • @aravindr2333
    @aravindr2333 Před měsícem +3

    for people not familiar with python typing , it will seem very hard . learning typing is need to be part of basic (from my exp)

    • @tomdekan
      @tomdekan  Před měsícem +1

      Thanks for the comment. No typing is required!
      In case you want to validate data with a schema, and are having difficulties, have you seen the ability to generate a schema from the models with Ninja? (django-ninja.dev/guides/response/django-pydantic/)

    • @tomdekan
      @tomdekan  Před měsícem +1

      No typing required! In case you want validate data with a schema, have you seen django-ninja.dev/guides/response/django-pydantic/

    • @Steven-wm9vu
      @Steven-wm9vu Před 18 dny

      @@aravindr2333 typing is beyond easy

  • @AbdennourHabchi
    @AbdennourHabchi Před měsícem +1

    hi thank u Tom for video , Django Ninja it's look like FastAPI

    • @tomdekan
      @tomdekan  Před měsícem +2

      You’re welcome and I agree with you. FastAPI and Django Ninja are quite similar. I like how Django Ninja is focused on Django. Might do a video on FastAPI💨

    • @AbdennourHabchi
      @AbdennourHabchi Před měsícem +1

      @@tomdekan Try FastAPI with HTMX ☄

    • @tomdekan
      @tomdekan  Před měsícem +1

      Nice idea :) 🚀

  • @AlexGarcia-ir7fl
    @AlexGarcia-ir7fl Před měsícem +1

    So basically FASTAPI + Django dev tools

    • @tomdekan
      @tomdekan  Před měsícem

      Yes + Django ORM integration. Here's a comparison for you Alex: django-ninja.dev/motivation/?h=fastapi

    • @Steven-wm9vu
      @Steven-wm9vu Před 27 dny +1

      Also async just works. Also, Swagger out of the box at /docs.

    • @tomdekan
      @tomdekan  Před 18 dny

      Good point. Swagger out of the box is great.

  • @destinyefe8996
    @destinyefe8996 Před 2 měsíci +3

    Thanks for the brief intro. what would become of DRF. Serializers 🙂. django-ninja is more straightforward

    • @tomdekan
      @tomdekan  Před měsícem

      You're welcome 🙂. True regarding DRF. I've used DRF a lot in production for different products/businesses. I think even the class-based serializers of DRF are unenjoyable to use.
      I find DRF's serializers are clunky when you want to avoid duplication. E.g sometimes you might need to get a temporary download link from your object storage, and bolt it onto the serializer.
      So, in short, Django Ninja looks like a superior to me.