title: a jinja variable for flask-app root directory
body: <p>I have been developing an app using the very easy-to-pickup <a href="http://flask.pocoo.org/" rel="nofollow">Flask</a> system and I have used a jinja template to write out a bunch of links that correspond to pages in Flask that are defined by something like this:</p>
  
  <pre><code>@app.route(/&lt;var1&gt;/&lt;var2&gt;)
  ...
  ...
  </code></pre>
  
  <p>in the test server these links work just fine however when I move from the test server to a server behind a proxy I get a problem where the href links don't take into account the extra directory name inserted by my proxy.</p>
  
  <pre><code>#where a link should read:
  server:/myapp/&lt;var1&gt;/&lt;var2&gt;
  # it acually puts out:
  server:/&lt;var1&gt;/&lt;var2&gt;
  </code></pre>
  
  <p>my jinja etemplate looks like this but I am wondering if instead of putting a backslash there is a way to put a variable that specifies root directory.  </p>
  
  <pre><code>{% block navigation %}
  {% for record in db.values() %}
   &lt;li&gt;&lt;a href="/{{db.name}}/{{record.name}}"&gt;{{record.name}}&lt;/a&gt;&lt;/li&gt;
  {% endfor %}
  {% endblock %}
  </code></pre>
  
  <p>Any help would be greatly appreciated. Thanks Flask team!</p>