In flask, I can do this:
render_template(\"foo.html\", messages={\'main\':\'hello\'})
And if foo.html contains {{ messages[\'main\']
I want to mention that url_for
cannot be used until it is added to the flask imports!
I spent an hour trying to find out why it would not work as no one mentioned that in several websites!!!
Add url_for
to the list of imports like this:
from flask import Flask, render_template, request, redirect, session, url_for