title: Loading mako templates from files
body: <p>I'm new to python and currently trying to use mako templating.
  I want to be able to take an html file and add a template to it from another html file.
  Let's say I got this <code>index.html</code> file:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Hello&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;    
      &lt;p&gt;Hello, ${name}!&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and this <code>name.html</code> file:</p>
  
  <pre><code>world
  </code></pre>
  
  <p>(yes, it just has the word world inside).
  I want the <code>${name}</code> in <code>index.html</code> to be replaced with the content of the <code>name.html</code> file.
  I've been able to do this without the <code>name.html</code> file, by stating in the render method what name is, using the following code:</p>
  
  <pre><code>@route(':filename')
  def static_file(filename):    
      mylookup = TemplateLookup(directories=['html'])
      mytemplate = mylookup.get_template('hello/index.html')
      return mytemplate.render(name='world')
  </code></pre>
  
  <p>This is obviously not useful for larger pieces of text. Now all I want is to simply load the text from <code>name.html</code>, but haven't yet found a way to do this. What should I try?</p>