传递多个参数时使用context={}字典形式

info.py

 1 from datetime import datetime
 2 
 3 @app.route('/info/')
 4 def person():
 5     class MyPerson(object):
 6         Email = 'jpal124@gmail.com'
 7         Time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
 8     dell=MyPerson()
 9     context={'username':'Jack','age':39,'pdell':dell}
10     return  render_template('info.html',**context)
View Code

相关文章:

  • 2022-01-22
  • 2021-06-02
  • 2022-01-18
  • 2021-09-17
  • 2021-07-04
猜你喜欢
  • 2021-09-01
  • 2021-10-19
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
相关资源
相似解决方案