How to Create an Instant Search Bar With Django and HTMX

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

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

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

    This video is gold. You deserve a lot more subscribers man. Try starting a podcast or releasing some shorts to gain more momentum. I'm not even saying this just for you, so many more people can be educated with such high quality content if you push further.

  • @tylerdurden4285
    @tylerdurden4285 19 วันที่ผ่านมา

    Excellent

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

    The legend himself back at it🎉🎉
    Some Quick questions, How long have you been programming? Do you use python as your main language?

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

      About 20 years. And yeah, I use Python as my main language. I've pretty much forgotten everything but Python and JavaScript, which is a shame, but that's what my business is focused on. Thanks for watching!

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

      @@prettyprinted That's a lot of years of experience.
      I would love to get in contact for some mentoring.
      I hope we can schedule something. I'll check your website

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

    I love this tutorial, but I do have a question regarding this topic. Suppose I have a form of country and city displaying on my html, and I want every time I select a country, HTMX is triggered to display the current saved city for that country below the form, how can I make that possible?
    I hope you can make a tutorial to explain how this can be achieved.
    Thanks for all the tutorials you have posted on your TH-cam channel, they are more than amazing.

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

    Awesome. Thx

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

    Can I do a video request?
    Can you make a video of a flask application with kafka.
    Where 1 route is creating data and 2 routes are using that data and data needs to be saved in database.
    (Additional) if 2nd route of reading data can update it.

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

    Despite how great and informative the tutorial is I have a bone to pick with these types of HTMX tutorials in the context of a Django project. Correct me if I'm wrong, Anthony, but this is not how you would do it in a template of a real Django project, right? Mostly due to `extends` functionality. We would always extend base.html (or similarly named) file in a template. So when you hx-target a div with a specific id, doesn't it mess up the whole layout of the page? Don't we have to use a librarly like django-htmx to check for `if request.htmx` condition in the view and then render the partial?
    Please tell me that I am a complete idiot if I confused myself here, I don't mind, I'm still learning.

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

      Extending a base template is useful so all your pages have a similar layout, and it's probably a good idea on normal pages, but it's not necessary on partial templates.
      When it comes to hx-target, you can target anything anywhere the template; you don't' need to target something that will break the page unless that's your intention.
      And finally, for libraries like django-htmx, I'm sure they offer some patterns and convenience features that are useful when using HTMX, but it's not at all necessary to use django-htmx or anything similar.
      Don't worry about this stuff being confusing though. There's a lot to learn so if the style of using templates in Django works for you now, continue with it.

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

      I believe all of the extends magic happens server side and since HTMX does have some JS but its hidden behind the special attributes it still executes client side. The only thing HTMX changes is where you would previously return a JSON you can return your result as a formatted HTML doc and it will take care of the rest.

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

    Hehe, i was just doing htxm and flask 😂
    Quick think i learn
    If i do request.json in a route. Then its header would switch to application/json.
    Why i was doing request.json
    Because i was trying to use hx-vals i thought these would be different from hx-params
    But turns out that they are just same.

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

    good

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

    Another simple but awesome tutorial Anthony💪. Thanks to remind me how to properly use `Q` class👌. Is it possible to convert a Django project to installation form, I mean like programs from `.exe` or `.deb` files? Forasmuch i have a computer in my work (Windows 11) without the internet access and i'm going to write a program to make my work easier and more efficient.