In Python

session['mytest'] = 'this is a text in the session!'

session['mydict'] = {
    'rule': 1,
    'count': 10,
    'title': 'test title',
}

In Jinja

可以用索引形式访问,也可以用对象形式访问:

<h1>{{ session['mytest'] }}</h1>

<h3>{{ session['mydict'] }}</h3>
<p>{{ session.mydict.title }}</p>