I have a table in the navigation system of my webapp that will be populated with up-to-date information each time a page is rendered. How could I avoid putting the following code in each view
?
def myview():
mydict = code_to_generate_dict()
return render_template('main_page.html',mydict=mydict)
mydict
is used to populate the table. The table will show up on each page
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…