I
I
idin2018-02-11 18:55:42
Django
idin, 2018-02-11 18:55:42

How to make sitebars in Django?

Let's say I'm building a website store or just an infoportal. And I understand from a bunch of tourtorials how to display the desired content on the page.
I create a model, then in the view, then on the content block, then on base.html, which, in turn, includes footer and header.
But I also have left and right columns in which there is not always static information, there is the last comment, top products, or just some information from some model (for example, a page about us, or a plate)
The question is how to connect such blocks correctly and how to create (otherwise I got a little confused, and I didn’t find really understandable information for myself)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-02-11
@sim3x

We make a common function with parameters We call
it in all view functions
Or we write a mixin and inherit from it in CBV

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question