May 2020
Intermediate to advanced
404 pages
10h 52m
English
Since we've already set up the base.html file, we can simply extend it in the board.html template file to create the billboard display page:
{% extends 'base.html' %}{% block content %}<div class="container"> <div class="row"> {% for bill in bills %} <div class="col-sm-4 py-2"> <div class="card card-body h-100"> <h2>{{ bill.billName }}</h2> <hr> <p> {{ bill.billDesc }} </p> <a href="#" class="btn btn-outline-secondary">{{ bill.user.username }}</a> </div> </div> {% endfor %} </div></div>{% endblock %}
In the preceding block of code, we have iterated over all the available bills items in the billboard's database and displayed them using a for loop in the template. The use of the base.html template allows us to reduce ...
Read now
Unlock full access