N
N
nano_e_t_42016-12-16 11:54:19
Flask
nano_e_t_4, 2016-12-16 11:54:19

How to set a variable in a template?

Hello everyone
Citizens comrades, plz remind, but rather poke into the documentation line, which tells how to set template variables through jinja. I did it once, but now I forgot :(

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cheremisin, 2016-12-16
@leahch

jinja.pocoo.org/docs/dev/templates/#assignments
Something like this
{% set myvariable = [1,2,3,4] %}

N
nano_e_t_4, 2016-12-17
@nano_e_t_4

solution found:
app.jinja_env.globals['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.jinja_env.globals.update()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question