Set variable in jinja
I would like to know how can I set a variable with another variable in jinja. I will explain, I have got a submenu and I would like show which link is active. I tried this: where recordtype is a variable given for my template.
I would like to know how can I set a variable with another variable in jinja. I will explain, I have got a submenu and I would like show which link is active. I tried this: where recordtype is a variable given for my template.
i use flask and i got this error when i call this url: /login Here’s my login method: And the traceback: I am absolutely sure the login.html is there(static/themes/default/404.html).Why can this occur?
Why the loop? You could simply do this: When you were originally doing your string comparison, you should have used == instead.
By default, Flask looks in the templates folder in the root level of your app. http://flask.pocoo.org/docs/0.10/api/ template_folder – the folder that contains the templates that should be used by the application. Defaults to ‘templates’ folder in the root path of the application. So you have some options, rename template to templates supply a template_folder param to have your template folder recognised by the flask … Read more