Jinja2 inheritance won't work

jinja2

Solution

You have to render title.html instead of base.html.

Problem

I'm trying to use inheritance in jinja2 on google app engine. But I haven't managed to do it so far. Could you please point me to what I am doing wrong? Here is my `base.html`: ``` {{text}} {% block title %} Failure {% endblock %} ``` this template is extended by the `title.html`: ``` {% extends "base.html" %} {% block title %} World!! {% endblock %} ``` Both templates are in the same directory `/templates/wiki`. This is how I load templates and render `base.html`: ``` import os import jinja2 import webapp2 template_dir = os.path.join(os.path.dirname(__file__), '../templates/wiki') jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir), autoescape = True) class MyHandler(webapp2.RequestHandler): def get(self): templ = jinja_env.get_template('base.html') self.response.out.write(templ.render(text = 'Hello,')) ``` The supposed output is Hello, World!!! but I can get just: Hello, Failure Jinja2 version is 2.6.

Original source