Django Ecommerce Website | Categories/Search | Htmx and Tailwind | Part 5

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

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

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

    The code is really clean... Not like your previous projects aren't clean... But, this is good... I'm seeing improvements... This is why I follow you...

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

      Hey! Thank you so much :-D I always try to improve, so it's nice that you've noticed it :-D

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

    Perfect tut. Keep the fire 🔥 because we love your skills

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

    Thank you a lot my mentoring hero. Much appreciated Stein.

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

      Thanks 😁😁 glad you liked it 👍🏻

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

    good totorial, its my hope that no 6 will comeout today... Thanks

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

    Many thanks mr Stein for your effort. in this vid around min 4:10, the list item of all categories, can we do away with the else statement?
    I know someone is going to say, "if you want to"😅

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

      Maybe, not 100% sure 🤷🏼‍♂️

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

    You are doing a great job bro... Keep Soaring Higher 🦅🦅🦅

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

    Amazing!!!

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

    4:25 i just realise i lost my "All Categories"... back to the 4 part...
    p.s. How to search in diffrent languiges?

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

      Hey, for more advanced search you need to install and set up something like hey, elastic, or similar :-)

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

    This is a very good one. Keep up!
    Could you please make a blog project. Thanks!

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

      Thanks 😁 I already have, just search on my channel 😉

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

      @@CodeWithStein I had become stuck with the blog project, that's why I asked. But I figured it out. Thanks!!!

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

    Thanks for your efforts 🙏🙏🙏🙏🙏

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

      You're welcome! Thanks for the comment :-D

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

    Thank you for your effort again Stein. I want to ask your opinion about htmx or vue? For a small to medium size ecommerce web site, would you prefer htmx(maybe plus alpine.js) or vue.js(or react)? What are the benefits of using a js framework over a light library like htmx or vice versa?

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

      I think I would suggest Htmx (or at least just use Vue some places in the ecommerce website). The "problem" with building the entire frontend with Vue/React, and then have a separate backend is security. It's not necessaraly a very big problem, but there is a lot more you need to think about when building headless. A combination of Htmx/Alpine is really great imo.

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

      @@CodeWithStein that is a good point. Thanks.

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

    nice video can you show how to have subesctrption based vendor in the next video

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

      No, that has nothing to do with this series ;-)

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

    search isn't working. when I am clicking on the search button, even url is not going to shop, instead showing
    :8000/?query=chair
    and showing all the products. What am i missing? code is same as yours.

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

      Hey, you probably have a typo somewhere in your code :-) Go over the video again and make sure there isn't any indentation error or similar ;-)

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

      @@CodeWithStein got it. thanks.

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

    Plz anyone can tell me that my search functionality is not working. Code is also same.In shop.html



    In views
    from django.db.models import Q
    def shop(request):
    categories = Category.objects.all()
    products = Product.objects.all()
    # Functionality For active category
    active_category = request.GET.get('category', '')

    # Functionality For filter category
    if active_category:
    products = products.filter(category__slug=active_category)

    # Functionality For search category
    query = request.GET.get('query', '')
    if query:
    products = products.filter(Q(name__icontains=query) | Q(description__icontains=query))
    return render(request,'shop.html',locals())

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

      Hey, what is "locals()"?
      return render(request,'shop.html',locals())

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

      @@CodeWithStein Thanks for reply sir

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

      locals() is a Python built-in function that according to the official Python documentation: Updates and returns a dictionary representing the current local symbol table. Free variables are returned by locals() when it is called in function blocks, but not in class blocks.

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

      But sir, like you, I have used the code , using context but search functionality is not working.

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

      Ah, I haven’t seen it before actually 😝 but i do not know why its not working. Maybe you’re running a different Python version?

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

    👍