Showing Products On The Homepage | Python Django Tutorials In Hindi #33

Python

Video is ready, Click Here to View ×


Full Django Playlist – https://www.youtube.com/playlist?list=PLu0W_9lII9ah7DDtYtflgwMwpT3xmjXY9
Source Code + Resources – http://www.codewithharry.com/videos/python-django-tutorials-hindi-15
►Click here to subscribe – https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww

Best Hindi Videos For Learning Programming:

►Learn Python In One Video – https://www.youtube.com/watch?v=qHJjMvHLJdg

►Learn JavaScript in One Video – https://www.youtube.com/watch?v=onbBV0uFVpo

►Learn PHP In…

23 thoughts on “Showing Products On The Homepage | Python Django Tutorials In Hindi #33

  1. Bhai new slide ka logic thoda galat hai aap ka… aapke code mai 8th product add karne par slides mai 4 products nahi aa rahe..

    {% if forloop.counter|add:1|divisibleby:4 and forloop.counter > 0 and not forloop.last %}

    try this.. this will work

  2. I have 9 product in database.
    When I run this code this show 4 products in 1St slide, but it shows 3 products in 2nd slide and then 2 products in 3 rd slide.

    If I do with divisible by 4 then it shows 5 products in 1St slide and 4 products in 2nd slide.

    Plz solve the problem

  3. Sir I've solved

    index.html

    <!–slide show starts here–>

    <div class="container carousel-inner no-padding">

    <div class="carousel-item active">

    {% for i in product|slice:"0:"%}

    <div class="col-xs-3 col-sm-3 col-md-3">

    <div class="card" style="width: 18rem;">

    <img src='{{i.image.url}}' class="card-img-top" alt="…">

    <div class="card-body">

    <h6 class="card-title">{{i.product_name}}</h6>

    <p class="card-text">{{i.desc}}</p>

    <a href="#" class="btn btn-primary">Add to cart</a>

    </div>

    </div>

    </div>

    {% if forloop.counter|divisibleby:4 and forloop.counter > 0 and not forloop.last %}

    </div>

    <div class="carousel-item">

    {% endif%}

    {% endfor%}

    </div>

  4. {% if forloop.counter|divisibleby:3 and forloop.counter > 0 and not forloop.last %}

    This logic is not working properly when we adding more item because when we add total 8 items it is showing 3 slides , i am trying to solve this , mind solving this problem Sir

Leave a Reply

Your email address will not be published. Required fields are marked *