Answer the question
In order to leave comments, you need to log in
Why don't third party apps work in django project?
I tried to make pagination in the project using bootstrap_pagination. Successfully installed this case via pip and added it to INSTALLED_APPS.
Sample:
<!DOCTYPE html>
{% extends 'base.html' %}
{% block content%}
{% load bootstrap_pagination %}
<div class="container">
{% for good in goods_indexes %}
<div class="row" style="background-color: #fff6de;height: 600px margin-bottom:0;">
{% for index in good%}
<div class="col-md-4" style="background-color: #fff6de; height: 300px margin-bottom:0;">
{% if index != -1%}
<div class="card" style="width: 18rem;">
<div class="card-body">
<img class="card-img-top" src="https://avatars.mds.yandex.net/get-pdb/911433/52a3d6de-d543-4686-a734-bb16ccab119f/s1200?webp=false" alt="Card image cap">
<h5 class="card-title">{{ index.name }}</h5>
{% if index.previous_price %}
<p class="card-text" style="text-decoration: line-through; color: #DC143C;">{{ index.previous_price }}</p>
{%else%}
<p></p>
{% endif %}
<p class="card-text">{{ index.price }}</p>
<a href="{{good.get_absolute_url}}" style="background-color: #a5d9cd" class="btn btn-primary">Buy</a>
</div>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% bootstrap_paginate page_obj%}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question