flask Template Inheritance tutorial

后端 未结 1 556
面向向阳花
面向向阳花 2021-01-11 12:24

I am running through the flask tutorial and I can not seem to get the Template Inheritance to work. below are the examples of my code

My base.html is:



        
相关标签:
1条回答
  • 2021-01-11 13:01

    Jinja extends works (superficially) like Python subclassing. You don't get an instance of a subclass when you instantiate a parent class, and you don't get the result of a child template when rendering the base template. Render the child template instead.

    return render_template('child.html')
    
    0 讨论(0)
提交回复
热议问题