Answer the question
In order to leave comments, you need to log in
How to call fuses from the temple?
Is it possible to call views from a template and get values from them in a worthless raid.
The result of the context processor is passed to all page templates, but we would like to selectively (if necessary, call several views from certain child templates).
Answer the question
In order to leave comments, you need to log in
First, please use normal terminology.
Second: when you call the template, you are passing Jinja2 a list of variables, right? You can also include the view functions that you need in this list and immediately call them in the template. Approximately as follows.
env.get_template("my_template.html").render({
'my_view': my_view,
})
<div>{{ my_view() }}</div>
Thank you! I will work on the terminology and read the manual more carefully...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question