R
R
RabbitRun92021-10-20 17:01:44
Django
RabbitRun9, 2021-10-20 17:01:44

How to transfer context from one view to several templates?

The question and the situation may be strange or funny. But for some reason nothing comes up.
In general, there is a view that considers the values ​​of the Product, and these values ​​are transferred by the context in variables to the template, the context, where they are then used.
And there is another template (even 2 pieces) where you need to display the same data from the same views.

Any help and advice is welcome.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2021-10-20
@RabbitRun9

Through Context processors for example

V
Vadim Shatalov, 2021-10-20
@netpastor

If for several views you need to add the same values ​​\u200b\u200bto the context, then look towards Mixin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question