Django-Ninja APIs - Modern API Development in Django

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.พ. 2025

ความคิดเห็น • 94

  • @seydinaoumarsamabaly1806
    @seydinaoumarsamabaly1806 ปีที่แล้ว +8

    I have learned django-ninja on this channel, but I can say this another level. Thank you so much man !

  • @AmoahDevLabs
    @AmoahDevLabs ปีที่แล้ว +10

    Oh wow. I can't believe you're doing a vidoe on Django-ninja again. Thanks very much.

  • @dowletaydogdyyew6360
    @dowletaydogdyyew6360 10 หลายเดือนก่อน +4

    Absolutely amazing video, I already fell in love with Django-Ninjas. Thank you so much!

    • @bugbytes3923
      @bugbytes3923  10 หลายเดือนก่อน

      Glad to hear that, thanks so much!

  • @sebwylleman
    @sebwylleman ปีที่แล้ว +5

    Another banger, love the consistency of this channel

  • @mahmoudtokura
    @mahmoudtokura ปีที่แล้ว +2

    This was beautiful to watch. I have always struggled with DRF; this will be my new go-to framework. It allows you to code as you picture it without restrictions or being overly opinionated.
    In my opinion, this is more pythonic.

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว

      Thanks for watching! Agreed - more Pythonic and a nicer dev experience!

  • @ahmedivy
    @ahmedivy ปีที่แล้ว +12

    The only thing i miss in fastapi was django like orm, and this was perfect

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +4

      Yes! The Django ORM cannot be beaten!

  • @stephancodes
    @stephancodes ปีที่แล้ว +4

    I really like django extension to populate the slug automatically. I normally created the prepopulated fields in the model admin, but this is much cleaner

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +1

      It's a cool field, for sure!

  • @dmitrymikhailovnicepianomu8688
    @dmitrymikhailovnicepianomu8688 ปีที่แล้ว +3

    Thank you! Can’t wait to see the continuation.

  • @MrValVet
    @MrValVet 6 หลายเดือนก่อน +2

    Thank you! You are my fave Django teacher :)

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      That's amazing, thanks a lot!

  • @alexsyzoniuk8335
    @alexsyzoniuk8335 7 หลายเดือนก่อน

    Thank you for turtorial - that's the best introduction into Django Ninja API so far I have seen

  • @theintjengineer
    @theintjengineer ปีที่แล้ว +2

    BugBytes' Videos are soo goood🤯🤯

  • @iwswordpress
    @iwswordpress 6 หลายเดือนก่อน +2

    Great! Video listed in the Django Ninja Docs means it is highly regarded by the author.

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      Thanks a lot for mentioning that, I didn't know!

  • @krizh289
    @krizh289 3 หลายเดือนก่อน

    Great video, here's hoping your django-ninja + next video has a tutorial for setting up authentication

  • @bob_dole_is
    @bob_dole_is ปีที่แล้ว +5

    I respect you seriously. In my previous company, we introduced Django-ninja. And integrated with Flutter for frontend. Your contribution to django ninja is very impressive. Also I think you have a stubborn philosophy about your works and I advocate it.

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +1

      Thanks a lot for this comment, really appreciate it! I hope django-ninja served your purposes in the previous company - would love to explore Flutter in future videos.

  • @laurelineparis5407
    @laurelineparis5407 หลายเดือนก่อน

    Thanks for sharing your experience.
    While following the videos, I was wondering few things
    I was wondering if you had any specific reasons for the followings otherwise approaches in the videos:
    - the update endpoint: while creating the endpoint to update the device location, you 've used defined your endpoint with verbs. To properly convey with REST good practices defining the endpoints withs the resources name could improve the APi
    - update request using post: maybe this was not the main focus, this could be improved by using patch or put methods.
    I am just curious to pick your mind on it.
    Once again, great and straight forward video ! Thanks

  • @robhafemeister3100
    @robhafemeister3100 ปีที่แล้ว +1

    Amazing how much and how fast I have learned from your videos. I really like django-ninja, FastAPI with the Django ORM.

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +1

      Thanks a lot Rob! And yeah, they're all great options.

  • @fabsync
    @fabsync ปีที่แล้ว +2

    super awesome man! Love always your approach. Looking forward to more videos on this series.. !

  • @SorryStamin
    @SorryStamin 7 หลายเดือนก่อน +2

    Thanks for the video. Excellently done.

    • @bugbytes3923
      @bugbytes3923  7 หลายเดือนก่อน

      Thanks a lot for the comment!

  • @swelanauguste6176
    @swelanauguste6176 ปีที่แล้ว +3

    Thank for the video. I have been waiting for a Django Ninja update video. Could you please do a video on django-extensions and Django-extras, I have seen you using it a few times

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +1

      Thank you. For sure, django-extensions would be worth covering in more detail - thanks for the suggestion!

  • @blees123
    @blees123 ปีที่แล้ว +1

    This is amazing work, keep up the great content.

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +2

      Thanks a lot! Will try my best :D

  • @knowledgedose1956
    @knowledgedose1956 3 หลายเดือนก่อน

    If you make a video using a more "clean" approach(use-cases, repositories, services etc) to which django-ninja would perfectly fit, that would be a banger(imho)

  • @codelabspro
    @codelabspro ปีที่แล้ว +7

    Can you do a video on authentication with Django-ninja please

    • @suc8270
      @suc8270 ปีที่แล้ว

      I need authentication too.
      Thank @bugbytes3923

  • @leoe.r.7338
    @leoe.r.7338 ปีที่แล้ว +1

    Great tutorial.

  • @jawadyaqub
    @jawadyaqub 6 หลายเดือนก่อน

    Thank you for this; it's great work.

    • @bugbytes3923
      @bugbytes3923  6 หลายเดือนก่อน

      Thanks a lot!

  • @deymonster2u
    @deymonster2u ปีที่แล้ว +2

    Very cool and simple! When will be the next video with React?

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +1

      Thank you! I think the follow-up video will be on Saturday!

  • @aek64
    @aek64 ปีที่แล้ว +2

    Greate video. I don't know how to make the api calls more secure. Can you use the built-in users that always exist in a Django site? I would love to see this in the next video because security is needed even for basic API:s.
    Maybe someone has a link to share how it is done.

  • @jamoinmoin
    @jamoinmoin ปีที่แล้ว +7

    I don't quite see the benefit of Ninja & Schemas over DRF & serializers. Am I missing something?

    • @sagiyoav
      @sagiyoav ปีที่แล้ว +1

      Following

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +9

      My understanding from reading opinions on reddit and other sites - is that a lot of people find serializers/views in DRF quite confusing when you need to go beyond basic CRUD stuff. I think there's a bit of a learning curve to understand its nuances, but I personally love DRF, and of course many others do too.
      I guess Ninja is just a different approach with less "magic" in the views.

    • @shintaii84
      @shintaii84 ปีที่แล้ว +1

      Async async async!

    • @knowledgedose1956
      @knowledgedose1956 3 หลายเดือนก่อน +1

      being async, and easier to implement clean architecture.

  • @aashayamballi
    @aashayamballi ปีที่แล้ว +2

    thank you!

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว

      Thanks a lot for watching!

  • @theintjengineer
    @theintjengineer ปีที่แล้ว

    In the Schema for Location, you have 'id', 'name'. I get the name part, since it's defined on the model. I also get the id on the Device Schema, since that's also on the Device Model. I just don't get where the id for the locations is coming from, since location has only a single field called 'name'.
    Thank you, BugBytes 🙌🏽

    • @steogen
      @steogen ปีที่แล้ว +1

      I believe the id field is added to all models by default. No need to be set up by the user. It’s necessary for the database to establish a unique primary key for each instance of the model

    • @theintjengineer
      @theintjengineer ปีที่แล้ว +1

      @@steogen, oooooh; and he explicitly sets up the id field for Device using uuid4 because he didn't want to have just a simple integer as the id for the devices, right? I get it now.
      Thank you very much. You're a good person🤝🏾

    • @steogen
      @steogen ปีที่แล้ว +2

      @@theintjengineer that’s my understanding too. Glad I could help ☺️

  • @lucaspires8187
    @lucaspires8187 6 หลายเดือนก่อน +1

    Can I create multiple apps to organize different contexts or use cases?

  • @jhalmu
    @jhalmu ปีที่แล้ว +1

    Thanks for wideo, I needed this. One question: What diffrence is use django-extras/extensions slug vs djangos slug.field?

  • @LawrenceLaurentMawanda
    @LawrenceLaurentMawanda หลายเดือนก่อน +1

    We appriciate

  • @frameff9073
    @frameff9073 ปีที่แล้ว +1

    thank you

  • @keyton_weissinger
    @keyton_weissinger ปีที่แล้ว +1

    Great video! Thank you. This looks like a great alternative to DRF to add a REST api to an existing Django app, no?

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +2

      Thanks a lot Keyton! That's exactly the use-case I think - if you have a Django app (or want to create one) that needs an API, then this is a nice alternative to DRF!

  • @MeetThoriya-o7b
    @MeetThoriya-o7b 5 หลายเดือนก่อน +1

    it that possible , to DeviceCreateSchema derive from ModelSchema ?,
    or can you explain please, when use schema and when use Modelschema ?

  • @mdsafikulislam9113
    @mdsafikulislam9113 4 หลายเดือนก่อน

    Is it suitable for industry standard?

  • @haseeb9621
    @haseeb9621 ปีที่แล้ว +1

  • @richcodesweb
    @richcodesweb ปีที่แล้ว

    Trying to create Many-to-Many relationships, you'd have thought that you'd do it in a similar way, `list[str]` but when I try this, I always get an error, saying that fields are missing, that don'e even appear in the schema, or the model ....

  • @JishnuDedeepya
    @JishnuDedeepya ปีที่แล้ว

    In django dynamic addcontanct button using htmx how to get single submitt button to submit multiple forms to database

  • @CristianMolina
    @CristianMolina ปีที่แล้ว

    Thanks for the video! One question: There are _2_ "get_devices" methods, for devices and locations endpoints but it still works, I assume because of the decorator but the 2nd method doesn't override the first one?

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว

      Yeah, this was a mistake (corrected in the django-ninja-extra video) - the second function should be called "get_locations()". It must work due to the decorator wrapping the function!

  • @dimasarestu2043
    @dimasarestu2043 ปีที่แล้ว +2

    Can i use it for existing django app?

  • @meesix
    @meesix ปีที่แล้ว +2

    Thank you for promoting Ukrainian products!

  • @DhavalAhir10
    @DhavalAhir10 ปีที่แล้ว +1

    Now No need of Django Rest Framework?

  • @marcosaugustoschultzwutke6670
    @marcosaugustoschultzwutke6670 ปีที่แล้ว +1

    Hello! I'm having difficulty connecting django 5.0 with the oracle 11g database. Do you know of any solution for this?

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +1

      I've not connected Django to Oracle for a while, so not sure what the issue is - sorry! Do you have any errors/exceptions that you're seeing?

    • @leftblank5315
      @leftblank5315 ปีที่แล้ว

      Please make sure the Instant Client is installed and in the path

    • @marcosaugustoschultzwutke6670
      @marcosaugustoschultzwutke6670 ปีที่แล้ว

      The Instant Client is installed and in the correct path. I have a Laravel application using Instant Client and it works perfectly. I read that Django 5 only works with Oracle version 19 or higher.@@leftblank5315

    • @seydinaoumarsamabaly1806
      @seydinaoumarsamabaly1806 ปีที่แล้ว

      Hey, to connect Django higher than 3 to oracle you may need Oracle 19c or higher. If you want specifically use your Oracle 11g, you have to downgrade to Django 3.2 or 3.1 or 3.0. Hope this helps !!!

    • @marcosaugustoschultzwutke6670
      @marcosaugustoschultzwutke6670 ปีที่แล้ว

      Thank you.@@seydinaoumarsamabaly1806

  • @Septumsempra8818
    @Septumsempra8818 ปีที่แล้ว

    Any CI/CD vids coming? I need to know the best strategies to update the database of a production site.
    Most tuts teach how migrations works and usually just delete them all (even in sql table) when they make a mistake. However, what's the process of taking a prod site, making a whole bunch of migrations (eg. Running field by field indexing effects on speed test) then once the desired migration is found, how do you ensure that only one migration file is created with only the final desired migration set?
    I like this one-file migration process, but it might not be the best way.
    Any suggestions on how to optimize migration workflows so as to keep up rolling out new features.

  • @leftblank5315
    @leftblank5315 ปีที่แล้ว +1

    I guess FastAPI is no longer modern?

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +1

      FastAPI is what I'd think of when talking about "modern" Python API frameworks - so yes, I'd say it is!
      Django-Ninja brings that approach to Django.

    • @leftblank5315
      @leftblank5315 ปีที่แล้ว +1

      @@bugbytes3923 my post was a bit sarcastic. It seems everyday there is a new framework. My point is, why would I learn yet another one, when FastAPI is well-established and is here to stay? Not to mention the author of Ninja is mixing politics into his work

    • @bugbytes3923
      @bugbytes3923  ปีที่แล้ว +5

      ​@@leftblank5315 This is specifically for Django apps that might need APIs. If you have a Django app - better to keep your API in Django, make use of the models/ORM, and avoid having a separate FastAPI app just to expose an API over the same data model.
      Ninja gives an alternative over Django REST Framework for developers that are familiar with, or prefer, the Pydantic/FastAPI way of doing things. Not much new to learn tbh, if you're already a fan of FastAPI. But remember, there are many thousands more web apps running Django than FastAPI - so ninja gives an easy way of migrating towards these new approaches without ditching Django entirely.
      No idea about the politics of the author. He's Ukrainian I believe, so ....

    • @leftblank5315
      @leftblank5315 ปีที่แล้ว

      @@bugbytes3923 it makes sense in the context of Django. I've used DRF for years.