Django live search | live search using django and javascript

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

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

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

    Hi Guys! Here is the source code for this project: github.com/hellopyplane/Live-search-using-django-javascript

    • @vidhyanipin
      @vidhyanipin 2 ปีที่แล้ว

      Hi how to search for images in the database. Like admin can search for users by giving profile pic

    • @invisiblehumor
      @invisiblehumor 2 ปีที่แล้ว

      Thanks

  • @Tanya-ut7zs
    @Tanya-ut7zs 4 ปีที่แล้ว +1

    Thanks. This is the first time I tried using Js in django using your video! :)

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

    Grt video sir. I am almost everytime first in your videos.

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

      Hi Coder ! I'm very grateful for your support :) Thank you!

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

    Fantastic video for learning

  • @stevenha3752
    @stevenha3752 3 ปีที่แล้ว

    Amazingly simple! Thank you.

  • @armaanalam65
    @armaanalam65 2 ปีที่แล้ว

    Amazing simple thank you......

  • @dhruvilshah9098
    @dhruvilshah9098 4 ปีที่แล้ว

    Awesome sir liking your content very much

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Thank you!

  • @old4827
    @old4827 2 ปีที่แล้ว

    Thanks a lot! Nice and simple

  • @anirudhk6109
    @anirudhk6109 2 ปีที่แล้ว

    great video

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

    how to filter on the basis of two attributes in Js ? like i have first_name and last_name as seperate attributes and i want to perform search on it

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

    great work Lucas, many thanks. But I tryed in my Post model where date ar in too and I think it is a problem for json (Object of type date is not JSON serializable). I think ş must find somethink else.

    • @Adroit931
      @Adroit931 3 ปีที่แล้ว

      it's simply solution to your views add default=str, like that -> json.dumps(list(Model.objects.values()), default=str)

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

    this is not live search, since you download all the objects. It is live filtering. However, if you have thousands of objects you would exhaust all available memory. What you should do a new ajax query each time a keyup event is registered and returning the first 10 results

  • @bharathr5936
    @bharathr5936 3 ปีที่แล้ว

    Your are simply great

  • @vasudevareddy5028
    @vasudevareddy5028 4 ปีที่แล้ว

    Nice sir..keep going,keep posting videos in and around Django..Ur Awesome sir :)

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Thank you Vasudeva!

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

    What is the extension in VSCode that ur using for organizing Jinja2 code ?

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Django by roberth solis

    • @vasudevareddy5028
      @vasudevareddy5028 4 ปีที่แล้ว

      @@Pyplane thanks sir :)

  • @DevsLikeUs
    @DevsLikeUs 4 ปีที่แล้ว

    Great tutorial, thank you.

  • @bharathparupati9426
    @bharathparupati9426 4 ปีที่แล้ว

    Once again....made ur mark luke👍

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Hi Bharath. It’s good to see that you are still here :) Cheers!

  • @liveinpeaceplease
    @liveinpeaceplease 4 ปีที่แล้ว

    Nice keep more coming 👍

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Thank you!

  • @ahmedkhairy482
    @ahmedkhairy482 3 ปีที่แล้ว

    Thanks for the great tutorial. I have a question how do I add more complex Django HTML for example {{item.get_absolute_url}} ?

  • @delllatitude299
    @delllatitude299 4 ปีที่แล้ว

    hi nice tutorial, can we get little bit advance of it. like searching and showing a spinner while getting data from database using ajax, and get results as drop-down on search box when we click on any search item it will go to that post. i hope i tell clearly. Thanks

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Hi. I'll think about it. Those videos on django with javascript have cool statistics so I think I'll make a few more on this :)

    • @delllatitude299
      @delllatitude299 4 ปีที่แล้ว

      @@Pyplane yes please. because i have done this task in datatables which is quite straight forward but i want custom search/autocomplete. Thanks

  • @everything5240
    @everything5240 4 ปีที่แล้ว

    as always superb!
    TEACHER, can we do CRUD operations on single template?

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

      Yes, shouldn’t be a problem :) for update and delete you can use modals to display the form or confirm delete

  • @yevgenletin5531
    @yevgenletin5531 2 ปีที่แล้ว

    thanks

  • @LouisAgyapong
    @LouisAgyapong 4 ปีที่แล้ว

    Great video. Can you do something on formsets. Like adding forms dynamically to a django formset with javascript.

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

      Hi Louis. Thanks for watching, for the comment & for the suggestion. I have already planned 4 additional videos to this series on django and js, but I'll also consider your idea. Cheers!

  • @TURKISTONIM2
    @TURKISTONIM2 3 ปีที่แล้ว

    it is JS bro we need django own search filter can you ??????

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

    Will this method cause memory overhead when searching in a large database? Lets say 10k?

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

      of course it will, it is live filtering, not live searching. He should do a new search each time a key up is registered and return only 10 results

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

      @@georgesmith3022 Ive managed to do it efficiently.

    • @mehedihasanpiash808
      @mehedihasanpiash808 3 ปีที่แล้ว

      @@ismailashraq9697 How?

  • @omarfateh1807
    @omarfateh1807 4 ปีที่แล้ว

    When I click on one of the results, is it possible to go the page of the item directly without hitting the search button , like Instagram search ? and how to customize the results , for example adding an image ?

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      I’m not sure I understand - we don’t have a search button here. Customize it however you want inside the for loop and in the innerHTML

  • @diescatric4559
    @diescatric4559 2 ปีที่แล้ว

    I got Object of type datetime is not JSON serializable because I have one of attribute is DateTimeField i'm not sure how I can fix this

  • @aryakurdo1706
    @aryakurdo1706 4 ปีที่แล้ว

    Hi thx btw its great tutorial, but is this safe for security I don't think this is that safe

  • @nastygambler2522
    @nastygambler2522 4 ปีที่แล้ว

    Mee too i like python and i like tesla... 😁😁 (0:26)

  • @mehedihasanpiash808
    @mehedihasanpiash808 3 ปีที่แล้ว

    How to mark/highlight the matched word at the same time while searching?

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

    How to pass inside js code?

  • @KrishnaManohar8021
    @KrishnaManohar8021 4 ปีที่แล้ว

    👌

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

    hey where is that box variable coming from????🙄🤔🤔🤔😠
    you haven't made a variable that goes like ' let box =document. getElement........'
    and you haven't done it at all at no point in time , i even checked the base.html file to see if it was there or something because I was literally going crazy trying to find out why that box variable is coming from nowhere and still works, but I couldn't find that variable anywhere..... So it's so confusing and annoying!!!! where does such box-variable come from which is not defined and still works!!!!! ????????????? whereeee? 🤔😡

  • @OxMiroslav
    @OxMiroslav 4 ปีที่แล้ว

    Please, can you share your code (link to github)?

    • @OxMiroslav
      @OxMiroslav 4 ปีที่แล้ว

      sorry, this request is already there. Please, ignore.

  • @eugenetuyizere8857
    @eugenetuyizere8857 4 ปีที่แล้ว

    Can you share the codes please?

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      I can't do it at this moment, but later I will upload it to github if you guys need it. Cheers

    • @eugenetuyizere5231
      @eugenetuyizere5231 4 ปีที่แล้ว

      @@Pyplane Thank you very much. I struggled to use this kind of search. But also need a hint to do in your code so that I can search through different columns in a table instead of a single column

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Eugene TUYIZERE hi, if you need a hint it will be to add an additional condition for the text that we type. Here we are only looking at the name, but we could also take a look description. Good luck

    • @eugenetuyizere5231
      @eugenetuyizere5231 4 ปีที่แล้ว

      @@Pyplane Thank you a lot

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      @@eugenetuyizere5231 Thanks for watching!

  • @72nilayneerav93
    @72nilayneerav93 3 ปีที่แล้ว

    github repo