Categories
How to add a variable available on all pages of the site?
For example, there is the add_template_global decorator, which adds a function that is available on all pages. How can you add the same variable?
Answer the question
In order to leave comments, you need to log in
Context processors
@app.context_processor def inject_user(): return dict(user='Это я')
<p>{{ user }}</p>
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question